...

View Full Version : Conflicting JavaScript and iframe?



OO7girl
06-15-2004, 07:02 PM
:confused:

I have an html calendar on my site. I want each day on the calendar to be clickable so that information about that day opens up in an iframe below the calendar. I had no problem with this until I added a javascript to the main document. This script is designed to detect the current date and display a certain html file in the iframe upon arrival at the calendar page. For some reason, since I have added the javascript, although the correct information pops up in the iframe automatically, whenever I try to click on a different date in the calendar to load new info in the iframe, it opens in a new window. I really need it to open in the iframe. In addition, I need this to work in Netscape 4.79, so ideally the content would also be loadable in a layer. I would also be open to substituting layers for the iframe altogether.
Does anyone know what I could be doing wrong?

Here's the link:
http://www25.brinkster.com/oo7girl/vimy/june.html

Thanks in advance!

glenngv
06-16-2004, 07:50 AM
You had a mismatch quotes in the name attribute

<iframe src="" id="todayInH" name="todayInH'

And you need <ilayer> for NS4 not <layer>. That is the counterpart of <iframe> in NS4.

Here's the modified code:


...
function insertSrc(){
if(document.layers){
document.layers['todayInH_NS'].src=adr;
}
else{
document.getElementById('todayInH').src=adr;
}
}

function setILayer(link){
if (document.layers){
document.layers[link.target+'_NS'].src=link.href;
return false;
}
return true;
}
...
<a href="0630eng.html" target="todayInH" onclick="return setILayer(this)">
...
<ilayer name="todayInH_NS" width="400px" height="500px">
</ilayer>

<iframe src="" id="todayInH" name="todayInH" frameborder="0" scrolling="no"
width="400px" height="500px"></iframe>

OO7girl
06-16-2004, 02:37 PM
You have no idea how much you've just helped me! Thank you so much....careless coding on my part :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum