New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ajax: Integrated native datatype, for XHR2 rich responseType support #1525
Changes from 4 commits
e5d31ab
42c0d4f
c681739
86d8712
4e7c71d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
0123 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1999,6 +1999,29 @@ module( "ajax", { | |
).always( start ); | ||
}); | ||
|
||
ajaxTest( "jQuery.ajax() - Native datatype", 8, [{ | ||
url: url("data/native.bin"), | ||
xhrFields: { | ||
responseType: "arraybuffer" | ||
}, | ||
success: function( data, status, jqXHR ) { | ||
strictEqual( data, jqXHR.responseNative, "The responseNative attribute contains the response" ); | ||
ok( data instanceof ArrayBuffer, "The data retrieved is an ArrayBuffer instance" ); | ||
var array = new Uint8Array( data ); | ||
strictEqual( array.length, 4, "Check for response length" ); | ||
deepEqual( [array[0], array[1], array[2], array[3]], [0, 1 ,2 , 3], "Check for response content" ); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. missing spaces inside brackets There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. incorrect spacing before commas |
||
} | ||
}, { | ||
url: url("data/native.txt"), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. missing spaces |
||
dataType: "native", | ||
success: function( data, status, jqXHR ) { | ||
strictEqual( data, jqXHR.responseNative, "The responseNative attribute contains the response" ); | ||
ok( typeof data === "string", "The data retrieved is a string" ); | ||
strictEqual( data.length, 5, "Check for response length" ); | ||
strictEqual( data, "0123\n", "Check for response content" ); | ||
} | ||
}]); | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This block has missing spaces inside parens and brackets all over the place. |
||
//----------- jQuery.active | ||
|
||
test( "jQuery.active", 1, function() { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing spaces