Click to See Complete Forum and Search --> : Targets in Javascript


Jack73
12-03-2002, 09:20 AM
Hi

Im a novice to Javascript and trying to write links within a left navigation. I want the link to change the main frame and left nav to remain.

I want to write target="content" (which is what Id write in HTML) but dont know how to do this in Javascript. Could you advise what options i can use and where i place them in Js?

Example of what Im trying to write...

<td CLASS="tds" onmouseover="fadeImg2(2)" onmouseout="fadeImgend2(2)" onclick="window.location.='hotissues.htm';" style="border:1px solid gray;background-color:#000066;width:150;text-align:left"><font color="white" size="1">Hot Issues-Fraud Prevention Alerts</td>

Many Thanks

gil davis
12-03-2002, 10:35 AM
onclick="window.location.='hotissues.htm';"
onclick="window.top.content.location.href='hotissues.htm';"

Jack73
12-03-2002, 10:40 AM
Its worked. Thanks...

I just cant get that theory to work when I am trying to link to another URL rather than a file.
ie
onclick="window.top.content.location.href='/livepub/secure/Finance/SID/Default.htm'";

Can you help?

gil davis
12-03-2002, 11:32 AM
What is the error?

Jack73
12-03-2002, 12:42 PM
It will not link to the URL that I have specified. The code seems fine when it is just another htm file but only doesnt seem to work when I put an address. (when I click it just doesnt do anything)

AdamGundry
12-03-2002, 01:29 PM
Are you specifing the http:// protocol on the front of the address? If not, this could be causing an error.

Jack73
12-04-2002, 02:40 AM
Yes that was it. Thank you!
Seem to have another problem now..sorry!!

I want the link to display a new frame rather than replace the main page. In HTML I have it as TARGET="useCont"

What would I need to do in the following...


onclick="window.top.content.location.href='http://www.intrawide.nbsnet.co.uk/livepub/secure/Finance/SID/Default.htm'";

Thank you.