Closed
Bug 361271
Opened 18 years ago
Closed 15 years ago
JavaScript functions are not defined at page load even though they have been declared
Categories
(Core :: General, defect)
Core
General
Tracking
()
RESOLVED
WORKSFORME
People
(Reporter: mozilla, Unassigned)
References
()
Details
Attachments
(1 file)
2.91 KB,
text/html
|
Details |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1) Gecko/20061010 Firefox/2.0
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1) Gecko/20061010 Firefox/2.0
This is an intermittent problem that only appears at certain times. The system complains about JavaScript functions not being defined but this is false as the functions have been declared earlier. Seems to be a timing issue on page load
Reproducible: Sometimes
Steps to Reproduce:
1. Visit above page and press F5 to refresh whilst moving the mouse over the link
2.
3.
Comment 1•18 years ago
|
||
Confirmed, moving the mouse over and out on the link while pressing F5 consistently triggered an error for me.
This doesn't make much sense, the script inside the onmouseover HTML event handler shouldn't be able to run before the script itself has been rendered. Perhaps this happens while the page is unloading, with the script functions being removed before the bound event handlers?
Comment 2•18 years ago
|
||
WFM, Mac trunk.
Updated•18 years ago
|
Component: Error Console → General
QA Contact: javascript.console → general
I have added some random text to increase the download time of the page. This helps to demonstrate the problem.
It appears as though the function is not available until the end of the document. This shows up regularly on bigger pages. The more content the page contains the worse the problem becomes.
Hope this helps,
Andy
Severity: normal → major
Version: unspecified → 2.0 Branch
We think this is the same bug as reported for the Prototype.js framework:
http://dev.rubyonrails.org/ticket/5393
Comment 6•18 years ago
|
||
I've confirmed this bug first occurring in Firefox version 1.5.0.1rc1. However, this is obviously more related to the core changes at the time (which seem to be related to 1.8.1). I haven't been able to find an immediately-suspicious ticket.
If there's any topic that this relates to, in particular, it's the execution of DOM events (either they're occurring too early, or their global context isn't being set properly). Although, I don't see any tickets that deal with that specific issue (for that particular release), so some hunting will still have to occur.
Product: Firefox → Core
QA Contact: general → general
Version: 2.0 Branch → Trunk
Comment 7•17 years ago
|
||
Attaching a revised version of the original test that uses mousemove events instead of mouse over, which makes reproducing the problem easier. (I usually 2-3 "customFunction is not defined" errors.)
This test demonstrates that event handlers are getting triggered without the scope-chain properly configured. In this case, the 'window' object does not appear to be in the scope chain, which is why "customFunction()" causes a ReferenceError, but "window.customFunction()" doesn't.
Comment 8•17 years ago
|
||
DUP of Bug 252542 (Reload case)? Test case is very similar to this bug's one.
See also Bug 199430 (load of new URL by FORM case).
Comment 9•15 years ago
|
||
The testcase works for me, and these symptoms were fixed, as bugs cited in comment 8 say. Resolving.
Status: UNCONFIRMED → RESOLVED
Closed: 15 years ago
Resolution: --- → WORKSFORME
You need to log in
before you can comment on or make changes to this bug.
Description
•