Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Jun 2002
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy 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
    Senior Coder
    Join Date
    Jun 2002
    Location
    Zwolle, The Netherlands
    Posts
    1,120
    Thanks
    2
    Thanked 31 Times in 31 Posts

    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

  • #3
    New to the CF scene
    Join Date
    Jun 2002
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #4
    New to the CF scene
    Join Date
    Jun 2002
    Location
    Ann Arbor, MI
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •