top.frames - IE vs FF vs Chrome

Hi
The following js function is used to handle our load reports page event in a web app…

function loadReports(){
    top.frames["ifrMain"].document.location = "Reports.aspx";
}

It works perfectly on IE and Chrome, however when the web app is ran in Firefox 14.01 this error occurs…
TypeError: top.frames.ifrMain is undefined
http://localhost:53427/js/Sidebar.js

We have ran Firefox in Safemode, disabled all plug ins, tried it on other FF installations etc but the problem remains.

Can anyone help as its proving rather tricky to find a solution that works on all three browsers.
Thanks
antonmsAsked:
Who is Participating?
 
grahamnonweilerCommented:
First give each of your frames ID tags as well as NAME tags - these should be the same.


Then it will depend a lot on how far nested your frames are.

If this JS function is called from top, then use:

    parent.ifrMain.location.href='Reports.aspx';


alternatively you can use:

    top.ifrMain.location.href='Reports.aspx';
0
 
antonmsAuthor Commented:
Hi - including the NAME tag as you suggested worked just fine in FireFox. Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.