View Full Version : Help - problems with document.write
sanuk
07-14-2002, 08:07 PM
Hi,
Can someone please help me,
I want to put a GOOD working JS-script in an external JS-file,
But I am having problem to == document.write == the following snippet:
==========
<FONT class=Tmenu onmouseout="this.style.color=#4d4c76" onmouseover="this.style.color=#fff5c6;show('m1')">Go To Submenu</FONT>
==========
Which I tried as follows:
==========
document.write('<FONT class=Tmenu onmouseout="this.style.color=#4d4c76" onmouseover="this.style.color=#fff5c6;show("m1")">Go To Submenu</FONT>')
==========
This does not work and gives me an Error
I presume it is near === show("m1") ===
I can not get this to work.
Thanks in advance,
Regards,
Sanuk
premshree
07-14-2002, 08:31 PM
Try this :
document.write('<FONT class=Tmenu onmouseout="this.style.color='#4d4c76'" onmouseover="this.style.color='#fff5c6';show('m1')">Go To Submenu</FONT>')
:thumbsup:
sanuk
07-14-2002, 08:49 PM
Hi,
Thanks for the reply,
But your solution does not work ! !
I can not use the == ' == bracket inside the document.write('......') line
That is the reason that I had replaced:
show('m1')
by
show("m1")
But it does not work ! !
Thanks anyway
Regards,
Sanuk
neil.c
07-14-2002, 09:17 PM
i've had problems with nested quotes before.
try putting 'm1' into a string variable before your write() statement:
document.write("<FONT class=Tmenu onmouseout='this.style.color=#4d4c76'
onmouseover='this.style.color=#fff5c6; var thingToShow='m1'; show(thingToShow)'>Go To Submenu</FONT>")
just an idea.
sanuk
07-14-2002, 09:55 PM
Thanks Neil
Tried your solution,
Still does not work
Thanks anyway
regards,
Sanuk
sanuk
07-15-2002, 04:23 AM
Hi,
I now have tried to chamge it in many ways.
Is it possible that the above snippet CAN NOT be put in a external JS file
OR is there somewhere a MISTAKE that our eyes are not seeing for the moment ???????
Regards,
Sanuk
premshree
07-15-2002, 06:59 AM
See the attachment......
That was what I meant...........but it got parsed when I posted.
It does work!
:thumbsup:
sanuk
07-15-2002, 08:59 AM
Hi,
Thank you Mr. Premshree for your help and time,
but your code does not work, maybe there is another problem.
I have now opened a new Post called "mission impossible", where I have attached the complete HTM-page including the problem JS-script.
Thank You
Regards,
Sanuk
premshree
07-15-2002, 12:08 PM
As far as the document.write is concerned there is no error......maybe there is some error in the functions that you have defined.
I use the same method in document.write when using functions.
I'll check out your code anyways.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.