...

View Full Version : Problem referencing windows in Firefox for Mac



drchrisheard
02-20-2009, 01:45 AM
Hello all! I have some code that works fine in Safari for Mac OS X but not in Firefox for Mac OS X, and I cannot figure out why.

At one point in the process, I loop through a (very short) list of URLs, open a new window for each, and store a reference to each new window:


winArray[loopCount][6] = window.open(url,winName);

Each of these windows has a DIV in it with id="detail". I want to load the contents of each "detail" DIV into a variable to extract some data from it. To load it up I used code like this:


var statblock = winArray[loopCount][6].document.getElementById("detail").innerHTML;

I then have code to parse the data stuffed into the statblock variable. The entire application works perfectly for me in Safari for Mac OS X, but in Firefox for Mac OS X, the app fails precisely when it reaches the second line of code shown above. I've checked, and winArray[n][6] does contain a window reference in Firefox.

Any ideas why this works in Safari but not Firefox, and how to fix it?

drchrisheard
02-20-2009, 02:22 AM
Here are a couple of additional details, by the way. I tried troubleshooting by replacing this:


var statblock = winArray[loopCount][6].document.getElementById("detail").innerHTML;

with this:


winArray[loopCount][6].focus();

Firefox did not bring the appropriate window into focus. So the problem seems to be with the window reference instead of the DIV reference but why only in Firefox? I'm confused.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum