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

document.write Quotations 3

Status
Not open for further replies.

MikeDee

Programmer
Aug 2, 2001
19
GB
When using document.write is it like this:-

document.write(" everything inside the double quote will be single quote ");

I've try it for the following and its giving me an error?

document.write(&quot;<td><img alt ='' border=0 height=10 src='&quot;images_topmenu/spacer.GIF&quot;' width=491 onMouseOver='MM_showHideLayers('Layer1','','hide','Layer2','','hide','Layer3','','hide','Layer4','','hide','Layer5','','hide')'></td>&quot;);
 
Well, you are correct.
Seems that you forgot to use + as concatenation of strings.
Just to be a little easier, I usually do something like:
str = &quot;&quot;;
str += &quot;<td>&quot;;
str += &quot;<img alt='' border=0 height=10 src='&quot;;
str += &quot;images_topmenu/spacer.GIF&quot;;
// and so on
document.write(str);
In such way it will be easier to debug where exactly is the error.
D.
 
hi Mike, avoid same quotes or mask 'em with
document.write(&quot;<td><img alt =\&quot;\&quot; border=0 height=10 src=\&quot;images_topmenu/spacer.GIF\&quot; width=491 onMouseOver=\&quot;MM_showHideLayers('Layer1','','hide','Layer2','','hide','Layer3','','hide','Layer4','','hide','Layer5','','hide')\&quot;></td>&quot;);


this have 2 be workin

regards, vic
 
oops, sorry, i am late.. :) regards, vic
 
Vic, you again added something to my knowledge!
D.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top