Closed Bug 615814 Opened 15 years ago Closed 14 years ago

edmunds.com avoids waiting for script's onload to fire if "Firefox" in the UA string

Categories

(Tech Evangelism Graveyard :: English US, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: tnikkel, Unassigned)

References

()

Details

Load the URL. The Price, Make, etc boxes don't get populated. If the page is in the cache then it works, but if you clear the cache is fails again. Bisected this down to the push containing bug 591981, and I doubt it was the other changeset in that push (removing spacers).
They sniff for "Firefox" in the UA string and avoid waiting for the script's onload handler to fire if "Firefox" in http://beta-static.ed.edmunds-media.com/edmunds-webassets/1.3.105/edmui/loader/loader-min.js I'll contact the site.
Assignee: nobody → english-us
Status: NEW → ASSIGNED
Component: DOM → English US
Product: Core → Tech Evangelism
QA Contact: general → english-us
Version: Trunk → unspecified
Blocks: geckoisgecko
Summary: edmunds.com page doesn't render correctly → edmunds.com avoids waiting for script's onload to fire if "Firefox" in the UA string
Removing bug 334967 from deps. This site has the opposite problem: Having "Firefox" in the UA string breaks the site.
No longer blocks: geckoisgecko
Oh, whoops, I misunderstood the problem. Sorry 'bout that.
I sent a message to the site using their site problem reporting UI.
The site acknowledged the problem and said it will be fixed.
I noticed something interesting while looking into this problem and I'm curious on your thoughts. It seems that when the async attribute is set to false on a script element the onload event has a different meaning than before. In this situation it seems that onload event fires when the file is download but not necessarily executed/evaluated. This can lead to a situation where you do not know when you can rely on the functionality in the script. If this is intended is there any event or flag that notifies when the script has been executed, an onexec/oneval event or state flag? var head = document.querySelector('head'); var s1 = document.createElement("script"); s1.async = false; s1.onload = function(){console.log('loaded::' + this.src);}; s1.src = "script1.js"; head.appendChild(s1); var s2 = document.createElement("script"); s2.async = false; s2.onload = function(){console.log('loaded::' + this.src);}; s2.src = "script2.js"; head.appendChild(s2); ----------console log-------------- loaded:: script2.js loaded:: script1.js
(In reply to comment #6) > I noticed something interesting while looking into this problem and I'm curious > on your thoughts. It seems that when the async attribute is set to false on a > script element the onload event has a different meaning than before. In this > situation it seems that onload event fires when the file is download but not > necessarily executed/evaluated. I can't reproduce the problem. Are you using a recent nightly build from http://nightly.mozilla.org/ ? The async=false behavior is not supported in Firefox 4 beta 7. > If this is intended > is there any event or flag that notifies when the script has been executed, an > onexec/oneval event or state flag? It is not intentional for onload to fire before the script has been executed. Firefox 4 dispatches a "afterscriptexecute" event on the script element after the script has been executed but before the "load" event is fired. However, this is currently not implemented in other browsers.
It was in the nightly builds but i can not reproduce anymore. It now works as expected. This issue has been address and pushed to our production servers. It was tested using nightly build 4.0b10pre (2011-1-24). Thanks for the heads up it is much appreciated. Let me know if I can be of any further assistance. Url used to test: http://www.edmunds.com/finder/car-finder-results.html?finder_q=type:Sedan;features:All-wheel%20drive Thanks again.
The boxes indeed do populate now. Thank you for fixing this!
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Product: Tech Evangelism → Tech Evangelism Graveyard
You need to log in before you can comment on or make changes to this bug.