Bug Tracker

Modify

Ticket #2978 (closed bug: invalid)

Opened 5 years ago

Last modified 4 years ago

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@…
Blocking: Blocked by:

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

comment:1 Changed 5 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 4 years ago by davidserduke

  • Status changed from new to closed
  • Resolution set to invalid

Ticket closed at the request of the reporter.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.