equal(decodeURIComponent(jQuery.param({a:[1,2,3],"b[]":[4,5,6],"c[d]":[7,8,9],e:{f:[10],g:[11,12],h:13}})),"a[]=1&a[]=2&a[]=3&b[]=4&b[]=5&b[]=6&c[d][]=7&c[d][]=8&c[d][]=9&e[f][]=10&e[g][]=11&e[g][]=12&e[h]=13","Make sure params are not double-encoded.");
equal(decodeURIComponent(jQuery.param({a:[1,2,3],"b[]":[4,5,6],"c[d]":[7,8,9],e:{f:[10],g:[11,12],h:13}})),"a[]=1&a[]=2&a[]=3&b[]=4&b[]=5&b[]=6&c[d][]=7&c[d][]=8&c[d][]=9&e[f][]=10&e[g][]=11&e[g][]=12&e[h]=13","Make sure params are not double-encoded.");
equal(jQuery.param(params),"a=0&a=1%2C2&a=3%2C4%2C5%2C6&a=%5Bobject+Object%5D&a=17","nested arrays (not possible when jQuery.param.traditional == true)");
equal(jQuery.param(params),"a=0&a=1%2C2&a=3%2C4%2C5%2C6&a=%5Bobject+Object%5D&a=17","nested arrays (not possible when jQuery.param.traditional == true)");
equal(decodeURIComponent(jQuery.param(params,false)),"a[]=1&a[]=2&b[c]=3&b[d][]=4&b[d][]=5&b[e][x][]=6&b[e][y]=7&b[e][z][]=8&b[e][z][]=9&b[f]=true&b[g]=false&b[h]=undefined&i[]=10&i[]=11&j=true&k=false&l[]=undefined&l[]=0&m=cowboy+hat?","huge structure, forced not traditional");
equal(decodeURIComponent(jQuery.param(params,false)),"a[]=1&a[]=2&b[c]=3&b[d][]=4&b[d][]=5&b[e][x][]=6&b[e][y]=7&b[e][z][]=8&b[e][z][]=9&b[f]=true&b[g]=false&b[h]=&i[]=10&i[]=11&j=true&k=false&l[]=&l[]=0&m=cowboy+hat?","huge structure, forced not traditional");
params={param1:null};
params={param1:null};
equal(jQuery.param(params,false),"param1=null","Make sure that null params aren't traversed.");
equal(jQuery.param(params,false),"param1=","Make sure that null params aren't traversed.");
params={"test":{"length":3,"foo":"bar"}};
params={"test":{"length":3,"foo":"bar"}};
equal(jQuery.param(params,false),"test%5Blength%5D=3&test%5Bfoo%5D=bar","Sub-object with a length property");
equal(jQuery.param(params,false),"test%5Blength%5D=3&test%5Bfoo%5D=bar","Sub-object with a length property");
...
@@ -2109,13 +2114,14 @@ test( "jQuery.ajax - Context with circular references (#9887)", 2, function () {
...
@@ -2109,13 +2114,14 @@ test( "jQuery.ajax - Context with circular references (#9887)", 2, function () {
context={};
context={};
context.field=context;
context.field=context;
try{
try{
success=!jQuery.ajax("non-existing",{
jQuery.ajax("non-existing",{
context:context,
context:context,
beforeSend:function(){
beforeSend:function(){
ok(this===context,"context was not deep extended");
ok(this===context,"context was not deep extended");
returnfalse;
returnfalse;
}
}
});
});
success=true;
}catch(e){console.log(e);}
}catch(e){console.log(e);}
ok(success,"context with circular reference did not generate an exception");
ok(success,"context with circular reference did not generate an exception");
equal(origTab.text(),"origval","Check original XML node was correctly set");
equal(origTab.text(),"origval","Check original XML node was correctly set");
equal(cloneTab.text(),"cloneval","Check cloned XML node was correctly set");
equal(cloneTab.text(),"cloneval","Check cloned XML node was correctly set");
start();
});
});
});
}
test("clone() on local XML nodes with html5 nodename",function(){
test("clone() on local XML nodes with html5 nodename",function(){
expect(2);
expect(2);
...
@@ -1755,4 +1775,12 @@ test("Guard against exceptions when clearing safeChildNodes", function() {
...
@@ -1755,4 +1775,12 @@ test("Guard against exceptions when clearing safeChildNodes", function() {
}catch(e){}
}catch(e){}
ok(div&&div.jquery,"Created nodes safely, guarded against exceptions on safeChildNodes[ -1 ]");
ok(div&&div.jquery,"Created nodes safely, guarded against exceptions on safeChildNodes[ -1 ]");
});
});
\ No newline at end of file
test("Ensure oldIE creates a new set on appendTo (#8894)",function(){
strictEqual(jQuery("<div/>").clone().addClass("test").appendTo("<div/>").end().hasClass("test"),false,"Check jQuery.fn.appendTo after jQuery.clone");
strictEqual(jQuery("<div/>").find("p").end().addClass("test").appendTo("<div/>").end().hasClass("test"),false,"Check jQuery.fn.appendTo after jQuery.fn.find");
strictEqual(jQuery("<div/>").text("test").addClass("test").appendTo("<div/>").end().hasClass("test"),false,"Check jQuery.fn.appendTo after jQuery.fn.text");
strictEqual(jQuery("<bdi/>").clone().addClass("test").appendTo("<div/>").end().hasClass("test"),false,"Check jQuery.fn.appendTo after clone html5 element");
strictEqual(jQuery("<p/>").appendTo("<div/>").end().length,jQuery("<p>test</p>").appendTo("<div/>").end().length,"Elements created with createElement and with createDocumentFragment should be treated alike");