#3281 closed bug (duplicate)
double requests in IE when appending script elements
Reported by: | arrix | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 1.3 |
Component: | ajax | Version: | 1.2.6 |
Keywords: | Cc: | arrix | |
Blocked by: | Blocking: |
Description
$(document.body).append($(document.createElement('script')).attr({ type: 'text/javascript', src: 'http://localhost/json.js' }));
The code above creates a script element, sets attributes and appends it to document using jQuery dom manipulation. In my IE7, two requests are sent to server. It turns out that IE7 sends the request right after you set the src attribute even if the script element is not attached to the document tree yet. Then jquery calls evalScript in append, making another request.
Though this is technically not a jQuery bug, it could cause hard to find bugs.
Change History (5)
comment:1 Changed 15 years ago by
Component: | core → ajax |
---|
comment:2 Changed 14 years ago by
Cc: | arrix added |
---|
comment:3 Changed 14 years ago by
Also, this appears like it may be a duplicate of #2612 which reports that the problem only occurs with an absolute URL.
comment:4 Changed 13 years ago by
Resolution: | → duplicate |
---|---|
Status: | new → closed |
Note: See
TracTickets for help on using
tickets.
Depending on the resolution of #3105 the behavior of this test case may change.
Is there a particular reason for creating/appending a DOM element vs doing it all in a string? Or does it happen for that case as well?