Page 1 of 1

SOLVED: using javascript in UDT

Posted: Mon Aug 06, 2007 8:04 am
by noborders
Hello,

I hope someone can help me with a small chalenge I'm facing. I'm using javascript in UDT. The code is:

echo '
bla bla bla
var WINDOW_HTML = 'Het achterhuis.';
bla bla bla
';

however just before the start and the end of the div tag I need to use the symbol ' . This symbol closes the echo statement and return an error. Could anyone tell me what I need to use to prevent the echo from stopping?

I hope I explain my self well.

Thanks for your help.

Regards,

Robert.

Re: using javascript in UDT

Posted: Mon Aug 06, 2007 8:16 am
by noborders
found it!

by using:

echo <<< END
blabla
END;

Re: SOLVED: using javascript in UDT

Posted: Mon Aug 06, 2007 9:38 am
by manurevah
i have the SAME issue and i was given a few solutions among which the "echo <<< END" solution, however i must be missing something crucial because this does not work for me and it is making me so sad...

this is what i put in for starters (the real script is alot longer, hence if i could manage not backslashing..)
:

Code: Select all

echo <<< END
<__script__ src="http://maps.google.com/maps?file=api&key=My_Key" type="text/javascript"></__script>
<__script__ type="text/javascript"> ";
END;
even:

Code: Select all

echo <<< END
blah blah
END;
does not work..

Re: SOLVED: using javascript in UDT

Posted: Mon Aug 06, 2007 8:06 pm
by Dr.CSS
Have you tried the literal trick...

{literal} your code {/literal}

Re: SOLVED: using javascript in UDT

Posted: Mon Aug 06, 2007 8:46 pm
by manurevah
yes i did, i even retried it just in case..  :  ]