View Full Version : Conflicting JavaScript and iframe?

06-15-2004, 07:02 PM

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:

Thanks in advance!

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(){

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

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

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 :)