Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Embed <script> inside a javascript function

Status
Not open for further replies.

benwiggy

Programmer
Nov 8, 2003
3
GB
I need to put a javascript inside a document.write function.

For example:
Code:
<SCRIPT>
newwin.write(&quot;hi<script src=''></script>&quot;);
</script>
The problem is that the close script tag closes the original open tag and so you get an unterminated string constant error.

Can anyone help?
 
try it with an escape <\/script> and I
have seen it borken with the '+' sign
like '</'+'script>'

HTH.

2b||!2b
 
Worked brilliantly.
Thank you thank you thank you.
From a happy webmaster. :)

You could just be a person to the world - but you may be the world to a person!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top