Skip to content

Commit d637ec3

Browse files
committed
For JSON and script requests, set the scriptCharset before the url so IE won't interpret it the wrong way; fixes jquery#4855.
1 parent 21178f2 commit d637ec3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ajax.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,10 +295,10 @@ jQuery.extend({
295295
if ( s.dataType === "script" && type === "GET" && remote ) {
296296
var head = document.getElementsByTagName("head")[0] || document.documentElement;
297297
var script = document.createElement("script");
298-
script.src = s.url;
299298
if ( s.scriptCharset ) {
300299
script.charset = s.scriptCharset;
301300
}
301+
script.src = s.url;
302302

303303
// Handle Script loading
304304
if ( !jsonp ) {

0 commit comments

Comments
 (0)