PDA

View Full Version : Cross browser problem with target


Michiel
08-25-2003, 06:01 PM
Hi,

today I've posted a question in the html forum and I was redirected to this forum (http://www.codingforums.com/showthread.php?s=&threadid=25285).

I'm using a javascript to display sublinks, and each sublink has got a target. In IE a new window opens when you click a sublink, where in NN 7 everything works ok.

The website can be found on http://www.marketing-congres.nl and the external javascript is located at http://www.marketing-congres.nl/scripts/menunavigation.js

Thanx in advance, Michiel

Cymru
08-25-2003, 07:25 PM
It's a little complicated with your frames, but try these:

1. Replace all occurances of output = ' ... ' with
output += ' ... ' (except for the first one)

2. Replace the end of your dosublinks function with this.

var x = document.getElementById ? document.getElementById('sublinks') :
document.all ? document.all['sublinks'] :
document.layers ? document.layers['sublinks'] : '';

if (document.getElementById)
{
x.innerHTML = '';
x.innerHTML = output;
}
else if (document.all)
x.innerHTML = output;

else if (document.layers)
{
x.document.open();
x.document.write(output2);
x.document.close();
}