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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

script tag into a string 1

Status
Not open for further replies.

fayna

Programmer
Jan 14, 2002
35
ES
Hi!I'm trying to insert <script> and </script> tags into a string this way:
<script>
funtion myFunction(){
str = &quot;<html><head><title>...</title><script>..</script>.....&quot;
}
</script>
But I get an error because <script> and </script> are not recognized like part of the string.
How can I solve this?
 
fayna,
I have answered the same question in thread216-195501

HTH --------------------------------------------------
Goals are dreams with deadlines
 
you must do it like this:

<script>
funtion myFunction(){
str = &quot;<html><head><title>...<\/title><script>..<\/script>.....&quot;
}
</script>

the 2 slashes i've added to your example are there to
make sure javascript reads em as a string.

Cheers,
BobbaFet

Everyone has a right to my opinion.
E-mail me at caswegkamp@hotmail.com

Heineken is like making love in a cano... it's f*cking close to water !!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top