Web Analytics Made Easy -
StatCounter hyperlink with JScript - CodingForum

Announcement

Collapse
No announcement yet.

hyperlink with JScript

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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>


  • #2
    Re: hyperlink with JScript

    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
    I am the luckiest man in the world

    Comment


    • #3
      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

      Comment


      • #4
        border=0

        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 >

        Comment

        Working...
        X