Page 1 of 1

javascript [Resolved]

Posted: Fri Jun 08, 2007 5:40 pm
by cwifi
Ok.. I wonder if anyone can shed some light on this.

I have the following code i need to use


document.write('');
document.write('email enquiry');


I understood that if i want to include this directly in the content i should wrap it in {literal} {/literal} - which i did.. but it just displayed the javascript code as content..

I then did the same with global content and user generated tags.. it did the same..

Finally I made it call the code from a .js file i created and all it did was display the code telling it to read the .js file.

Any idea's ?

Re: javascript

Posted: Fri Jun 08, 2007 6:02 pm
by calguy1000
the only time you need to include {literal} scripts is when there are { and/or } characters in your javascript
the rest of the time, the javascript should fit into your page template or page content without any of these.

Re: javascript

Posted: Fri Jun 08, 2007 6:16 pm
by cwifi
I see, I removed them but still the code gets dumped straight onto the page as if it was content.. any idea's ?

Re: javascript

Posted: Fri Jun 08, 2007 6:27 pm
by calguy1000
It's Probably a broken tag further above.

Re: javascript

Posted: Fri Jun 08, 2007 6:36 pm
by cwifi
In the content ?

There's only a few words and one UDT