Skip to main content

Bug Tracker

Side navigation

#10899 closed bug (invalid)

Opened November 26, 2011 12:19PM UTC

Closed December 09, 2011 08:54AM UTC

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

Attachments (0)
Change History (3)

Changed December 05, 2011 02:07PM UTC by sindresorhus comment:1

_comment0: 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. \ \ [http://wroug.com/stuff/testcases/jquery-10899-load-order/ Testcase] showing it works correctly. \ Also made a [http://wroug.com/public_html/stuff/testcases/jquery-10899-load-order/testcase.zip download]. \ \ Let me know if you can reproduce the issue with this testcase.1323420793117989
component: unfiledajax
owner: → Finn
priority: undecidedlow
status: newpending

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.

Changed December 09, 2011 07:55AM UTC by Finn comment:2

status: pendingnew

(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.

Changed December 09, 2011 08:54AM UTC by sindresorhus comment:3

resolution: → invalid
status: newclosed

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