Forum Moderators: open
Im a newbie so be gentle with me. OK so heres my first question.
I'm using the following:
document.all.iFrame1.src = "mypage.html";
What would be a better way of doing this that NN would be ok with? (I've seen a similar post that mentions the use of the getElementbyID() method - would this be a better way of doing it?)
getElementById will only work in DOM1 complint browsers (IE5+, Mozilla, Opera 5+ and Netscape 6+). You would write a script to accommodate all browser types.
However, a better approach may be to use the document.frames element and change the the URL by using the location method.
Ok I tried this:
document.frames['iframe1'].location = "myPage.html";
and
document.frames[0].location = "myPage.html";
..and it works fine in IE5.5/6.0 but not NN6.2
..Im calling a user defined function where the parameter is the location to be loaded from an anchor i.e.
<a href="javascript:myfunction(mylocation);">
does this change things?
why do I always have to complicate matters :)
thanks guys