Results 1 to 4 of 4

Thread: simple link script error

  1. #1
    Join Date
    Oct 2006
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default simple link script error

    I am using this script to make a changeable link for multiple pages,
    this goes in the pages and all I have to do is edit the file tiger.js

    <script src="tiger.js" type="text/javascript"></script>

    <script language="JavaScript" type="text/javascript">
    <!--
    document.write("<a href=\"" + toppic_link + "\">")
    document.write("<img border='0' src='images/toppic.gif' width='461' height='80'>")
    document.write("</a>")
    //-->
    </script>


    I then have this in tiger.js, this is my changable link

    var toppic_link = "http://www.tstiger.org.uk"


    But sometimes I want to open the link in a new window so i would add target="new" onto the end of the var in tiger.js like this

    var toppic_link = "http://www.tstiger.org.uk' target='new'"

    but it don't work

    I know it is something to do with the speech marks and I have tried using ' as I thought that was correct but still no good

    any help would be appreciated
    thanks

  2. #2
    Join Date
    Oct 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by pdsok
    I am using this script to make a changeable link for multiple pages,
    this goes in the pages and all I have to do is edit the file tiger.js

    <script src="tiger.js" type="text/javascript"></script>

    <script language="JavaScript" type="text/javascript">
    <!--
    document.write("<a href=\"" + toppic_link + "\">")
    document.write("<img border='0' src='images/toppic.gif' width='461' height='80'>")
    document.write("</a>")
    //-->
    </script>


    I then have this in tiger.js, this is my changable link

    var toppic_link = "http://www.tstiger.org.uk"


    But sometimes I want to open the link in a new window so i would add target="new" onto the end of the var in tiger.js like this

    var toppic_link = "http://www.tstiger.org.uk' target='new'"
    but it don't work

    I know it is something to do with the speech marks and I have tried using ' as I thought that was correct but still no good

    any help would be appreciated
    thanks
    Uhh... i think
    Code:
    var toppic_link = "http://www.tstiger.org.uk' target='new'"
    needs to have a ' at the beginning after the "... just saying.. lol maybe u can just put the link or attach in zip so i can see 4 myself and then give it back if i get it right...

  3. #3
    Join Date
    Oct 2006
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    attached zip has all 3 files to show what i'm tryin to do

    thanks

  4. #4
    Join Date
    Oct 2006
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Uhh... i think
    Code:

    var toppic_link = "http://www.tstiger.org.uk' target='new'"


    needs to have a ' at the beginning after the "...
    no, I tried that and it still doesn't work, :/

Bookmarks

Posting Permissions

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