Bug Tracker

Modify

Ticket #10899 (closed bug: invalid)

Opened 2 years ago

Last modified 2 years ago

jQuery.load() executes scripts in wrong order

Reported by: Finn Owned by: Finn
Priority: low Milestone: None
Component: ajax Version: 1.7.1
Keywords: Cc:
Blocking: Blocked by:

Description

When jQuery.load() loads HTML with both inline and external scripts, all inline scripts are always executed before the external ones. Additionally, the .load() callback function is called after the inline scripts, but before the external scripts.

Test case fiddle here:  http://jsfiddle.net/TEMLZ/4/

The test case shows the same behaviour on IE 8, FF 3.6, Opera 11.50 and Chrome 12.0.

Change History

comment:1 Changed 2 years ago by sindresorhus

  • Owner set to Finn
  • Priority changed from undecided to low
  • Status changed from new to pending
  • Component changed from unfiled to ajax

Can confirm this on jsFiddle, but I tried your testcase outside jsFiddle and got the correct order, so it seems jsFiddle is screwing up the order somehow.

 Testcase showing it works correctly. Also made a  download.

Let me know if you can reproduce the issue with this testcase.

Last edited 2 years ago by sindresorhus (previous) (diff)

comment:2 Changed 2 years ago by Finn

  • Status changed from pending to new

(Correct download link to your testcase:  http://wroug.com/stuff/testcases/jquery-10899-load-order/testcase.zip)

Good observation. I cannot reproduce this issue in your testcase, neither online nor locally. The local testcase did not load on Chrome and Opera however.

comment:3 Changed 2 years ago by sindresorhus

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

That's because those browser don't allow local XHR.

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.