Cross Browser Iframe Referencing

wxdqz

New Member
I'm making a site which has an iframe and a number of links, which when pressed change the source of the Iframe.

I was using this code:

function setframe(cnt)
{
if (cnt==1){document.getElementById("frame").src='page1.html';}

if (cnt==2){document.getElementById("frame").src='page2.html';}

if (cnt==3){document.getElementById("frame").src='page3.html';}
}


activated by a link such as <a href=http://www.webdeveloper.com/forum/archive/index.php/"#" onclick="javascript:setframe(1);">Page 1</a>

the iframe has the id of frame.

However, I've noticed that it works fine in IE 5+, Mozilla and Netscape 6+, however, it doesn't work in Opera 6+.

And as I'm a huge fan of this browser I'd like for it to work.

Can some one tell me how to reference the iframe for it to work in more browsers?

Many thanks

demonseed101
 
Back
Top