I need to be able to insert Javascript into a webpage via an Umbraco Document property. How do I do this?
1 Answer
Add a field to your document type with the type Textbox Multiple. Give it an appropirate alias like HeaderCode.
Add a reference to HeaderCode in your template.
<html>
<head>
...
<script type="text/javascript">
<umbraco:Item runat="server" field="HeaderCode"/>
</script>
</head>
...
</html>
You can now enter your script into the HeaderCode, e.g.
$(function() {
// Stuff to do on page ready.
});