views:

347

answers:

2

Hi,

I have a page generated by php which includes two drop-down lists (SELECTs) which contain a lot of items (about 2,000 each). The page is fine, but when it loads in Firefox, there's a delay during the load, and then it seems to refresh the entire page. If a user tries to click on anything before the "reload" occurs, it has no effect.

In Explorer, each drop-down just takes a while (a second or two) to appear, which is fine.

Anyone know what this is? And aside from using AJAX to dynamically fill the drop-down list, is there an easy way to avoid it?

EDIT: Additional information. I have got my PHP script to output to a log file whenever it is called, so I can now see that what seems to be happening is this:

A call is made to the PHP script, and the page starts to load. After a few seconds, another identical call is made to the PHP script, at which point the page starts to load again. This time it completes loading. So I guess it seems like the browser refreshes the page automatically for some reason before the page finishes loading.

Thanks,

Ben

+1  A: 

Wild shot in the dark: Do you have any images or hidden image submit buttons with BLANK src? I needed to 'fake' a 'default enter' effect for a textbox and used a hidden image button before all the fields. Since it was hidden, I left the src attribute blank. Firefox loaded the page twice! Pointing the src attribute at a single-pixel but real image fixed it.

n8wrl
Hi,that's interesting: it sounds like you experienced a similar effect to me. Unfortunately, I don't think that's it, as the page doesn't have any images on it at all. It does have a few submit buttons, but they're not IMAGE type ones...Ben
Ben
+1  A: 

First, you should use a network sniffer like wireshark to confirm that the page really loads twice. Then, confirm that it happens only with firefox; Then, you are on the good way ! I experienced a variant of what n8wrl is proposing; it was in some css declarations with some empty background-image property --> Check your CSS for empty file declarations

MatthieuP
Thanks matthieu. Good tips there. Interestingly, if I keep everything the same but have fewer items in the drop-down list, the problem goes away...
Ben