Bug Tracker

Modify

Ticket #8212 (closed bug: worksforme)

Opened 2 years ago

Last modified 2 years ago

Attach script load/readystatechange before script.src in cross-site ajax request

Reported by: dmethvin Owned by:
Priority: low Milestone: 1.next
Component: ajax Version: 1.5
Keywords: needsreview Cc: jaubourg
Blocking: Blocked by:

Description

IE can sometimes fire ready right after script.src is set if the file is in cache. Just need to move the set below the attach of the handlers.

 http://www.thefutureoftheweb.com/blog/image-onload-isnt-being-called

 https://github.com/jquery/jquery/blob/master/src/ajax/script.js#L51

Change History

comment:1 Changed 2 years ago by jitter

  • Cc jaubourg added
  • Priority changed from undecided to low
  • Component changed from unfiled to ajax

This sounds interesting but needs extensive testing across all supported browsers (which with this caching issues is a pain) as, judging by the comments on the blog post, this may not be fool proof and could start failing in other browsers other randomly.

comment:2 Changed 2 years ago by rwaldron

  • Keywords needsreview added

comment:3 Changed 2 years ago by jaubourg

While I would understand the behaviour for Image, I seriously doubt this would apply to script tags seeing as they're not loaded before the tag is injected into the document afaik. I may be wrong but I never ran into the problem before. Do you have tests to back this up, Dave?

comment:4 Changed 2 years ago by dmethvin

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

In creating some tests I don't see it failing in IE6 or IE8 so I will close this.

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.