...

View Full Version : hyperlink with JScript



kcabe
06-17-2002, 02:16 PM
Hello,

I try to have displayed an hyperlink button with javascript embeded in my body but can not get the href to work properly. it destroy the table because of this double tag (pic+hrf) tried to pass variables but doesn't work either. wondering if my syntax is correct?

Thanks

<TD>
<SCRIPT LANGUAGE="JavaScript">
<!--
if (queryString == "web")
document.write("<a href="page1.htm"> <img src='Templates/dw_templates_cm/main/images/cm_main_07.jpg' width='114' height='19'> </a>");
else if (queryString == "firstclass")
document.write("<img src='Templates/dw_templates_cm/main/images/query.jpg' width='114' height='19'>");
//-->
</SCRIPT></TD>

:)

Roelf
06-17-2002, 02:55 PM
Originally posted by kcabe
Hello,

I try to have displayed an hyperlink button with javascript embeded in my body but can not get the href to work properly. it destroy the table because of this double tag (pic+hrf) tried to pass variables but doesn't work either. wondering if my syntax is correct?

Thanks

<TD>
<SCRIPT LANGUAGE="JavaScript">
<!--
if (queryString == "web")
document.write("<a href=\ "page1.htm\ "> <img src='Templates/dw_templates_cm/main/images/cm_main_07.jpg' width='114' height='19'> </a>");
else if (queryString == "firstclass")
document.write("<img src='Templates/dw_templates_cm/main/images/query.jpg' width='114' height='19'>");
//-->
</SCRIPT></TD>

:)

you messed up the quotes, insert backslashes as i did and the thing will probably work

kcabe
06-17-2002, 03:08 PM
thanks it works but (there is always a but) it still mess up the template because explorer see this double tag and i get this double border around my picture is there a way to get around it?

thanks

SilentService
06-17-2002, 03:26 PM
Change:
<img src='Templates/dw_templates_cm/main/images/cm_main_07.jpg' width='114' height='19'>


by adding:
border=0

result:
<img src='Templates/dw_templates_cm/main/images/cm_main_07.jpg' width='114' height='19' border=0 >:rolleyes:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum