...

View Full Version : Page only loads correctly once in IE, incorrectly once in FF



Malkalypse
04-17-2005, 11:08 PM
I am working with using Javascript to create a page that scales and keeps its aspect ratio (much like a Flash page would). After a lot of trial and error, I have a prototype up with a couple of problems.

It loads correctly once in I.E. Reloading, or opening a new browser, will also load the page correctly. But visiting a different page and coming back causes the width attributes to break. This happens with the non-aspect-ratio version in pure HTML also, but I was hoping that this problem would be solved by establishing values based on javascript variables.

As for Firefox, the problem is more or less exactly the opposite. The page loads up all wonky the first time, and a reload or resize will fix it for every time afterward.

To see what I'm talking about, you can take a look at
http://www.jonesmfgmusic.com/testpage_setup/problem_width.html

For the HTML only version, see
http://www.jonesmfgmusic.com/testpage_setup/problem_html.html

I'm guessing this is something to do with the order in which the data is loaded, so that once the information is all cached, it stops functioning in IE, and starts functioning in FF... can anyone confirm whether I'm on the right track with that, or how to fix it if I am?

I'm most concerned by the fact that the width attribute is behaving as it does in IE. That looks like some kind of Microsoft bug to me, and I need a way around it. As for Firefox, I am guessing if I can just get it to load all of the correct information ahead of time, the page should come up correctly, but I just can't think how to do that.

Malkalypse
04-19-2005, 04:18 AM
Incidentally, I've had some people say that they can't see the problem.

"Reload" doesn't cause a problem, while sometimes closing and reopening the browser does.

To see the functionality break down, please look at

http://www.jonesmfgmusic.com/testpage_setup/problem_width_l.html

click on "LINK", and then "Go Back" from the new page.

yeoldedude
02-16-2010, 04:30 AM
I know this is an old thread but want to post a possible answer for anyone googling for it.

I had a page which similarly wasn't loading correctly in FireFox the first time, but would after reloading. As OP suggested it did have something to do with caching --- I was defining background images for :before and :after psuedoclasses (of divs) in css, and the problem was that the browser (due to a a bug I'd imagine) was finalizing the layout before loading the images (whose size affects the positioning of other elements).

The trick was to preload the images with javascript, as in:


<script type="text/javascript">
var theImage=new Image();
theImage.src="mypicture.jpg";
</script>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum