PDA

View Full Version : simple link script error



pdsok
10-30-2006, 05:23 PM
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

roflmao456
10-30-2006, 10:09 PM
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


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

pdsok
10-31-2006, 03:24 PM
attached zip has all 3 files to show what i'm tryin to do

thanks

pdsok
11-05-2006, 08:04 PM
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, :/