Fixed #2046 by forcing the dataType to 'html' in the .load() function.
This commit is contained in:
parent
56a93fc2cc
commit
06c2f06a21
2 changed files with 24 additions and 10 deletions
|
@ -34,6 +34,7 @@ jQuery.fn.extend({
|
||||||
jQuery.ajax({
|
jQuery.ajax({
|
||||||
url: url,
|
url: url,
|
||||||
type: type,
|
type: type,
|
||||||
|
dataType: "html",
|
||||||
data: params,
|
data: params,
|
||||||
complete: function(res, status){
|
complete: function(res, status){
|
||||||
// If successful, inject the HTML into all the matched elements
|
// If successful, inject the HTML into all the matched elements
|
||||||
|
|
|
@ -317,6 +317,19 @@ test("load('url selector')", function() {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test("load(String, Function) with ajaxSetup on dataType json, see #2046", function() {
|
||||||
|
expect(1);
|
||||||
|
stop();
|
||||||
|
$.ajaxSetup({ dataType: "json" });
|
||||||
|
$("#first").ajaxComplete(function (e, xml, s) {
|
||||||
|
equals( s.dataType, "html", "Verify the load() dataType was html" );
|
||||||
|
$("#first").unbind("ajaxComplete");
|
||||||
|
$.ajaxSetup({ dataType: "" });
|
||||||
|
start();
|
||||||
|
});
|
||||||
|
$('#first').load("data/test3.html");
|
||||||
|
});
|
||||||
|
|
||||||
test("load(String, Function) - simple: inject text into DOM", function() {
|
test("load(String, Function) - simple: inject text into DOM", function() {
|
||||||
expect(2);
|
expect(2);
|
||||||
stop();
|
stop();
|
||||||
|
|
Loading…
Add table
Reference in a new issue