Bug Tracker

Opened 12 years ago

Closed 11 years ago

#2978 closed bug (invalid)

Possible $().ready() bug in Safari 3.1.1

Reported by: jmar777 Owned by:
Priority: major Milestone: 1.3
Component: core Version: 1.2.5
Keywords: document, ready, Safari, CSS Cc: jmar777@…
Blocked by: Blocking:

Description

Just started following the tickets here, so sorry if this is a dupe.

I say "possible" bug because I am not sure what the specs are on this issue. Most browsers seem to load any external style sheets prior to executing the $().ready() method - however, this does not seem to be the case in Safari 3.1.1 (tested in Windows). This inconsistency was unexpected to myself, and I would assume to others as well. Needless to say, this causes problems if a script/plugin is dependent on said style sheets.

I am led to believe that the CSS is the culprit by two observations:

  • Such scripts execute successfully if run after the document.onload event.
  • Such scripts execute successfully if the CSS is inlined.

For a specific example, my Kwicks plugin (http://www.jeremymartin.name/examples/kwicks.php?example=1) pulls bits of information from an external style sheet, and therefore fails in Safari 3.1.1 (if executed by $().ready()).

I have only tested this with 1.2.3 and 1.2.6, which both exhibited this behavior.

Thanks for all the great work!

Change History (2)

comment:1 Changed 12 years ago by jmar777

I don't think I have the rights to do it myself, but I suggest that this issue be removed as a non-issue.

I have more recently discovered that the script also works if the CSS is included before the JS. My assumption now is that Safari 3.1.1 simply applies/runs the CSS/JS in the order that it is referenced, whereas other browsers *appear* to always apply the CSS first. I couldn't find any documentation regarding the "correct" approach, so I would not consider this to be a bug on the part of jQuery or Safari at this point.

I am still curious what would be considered "expected" browser behavior here, but that would be a discussion for a different venue. Thanks again!

comment:2 Changed 11 years ago by davidserduke

Resolution: invalid
Status: newclosed

Ticket closed at the request of the reporter.

Note: See TracTickets for help on using tickets.