Helpful Information
 
 
Category: JavaScript programming
hyperlink with JScript

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>

:)

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

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

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:










privacy (GDPR)