From 48837b92b03a5cb0f37fe49963d5e34a658bf214 Mon Sep 17 00:00:00 2001 From: Dave Methvin Date: Mon, 3 Mar 2014 21:37:56 -0500 Subject: Ajax: .load() should trim its selector Fixes #14773 (cherry picked from commit 3a68c114e3a30af86dc261c9d62ce2ae4144d420) Conflicts: src/ajax/load.js --- test/unit/ajax.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test/unit') diff --git a/test/unit/ajax.js b/test/unit/ajax.js index 80531f984..4b4e408a3 100644 --- a/test/unit/ajax.js +++ b/test/unit/ajax.js @@ -1850,6 +1850,14 @@ module( "ajax", { }); }); + // Selector should be trimmed to avoid leading spaces (#14773) + asyncTest( "jQuery.fn.load( URL_SELECTOR with spaces )", 1, function() { + jQuery("#first").load( "data/test3.html #superuser ", function() { + strictEqual( jQuery( this ).children("div").length, 1, "Verify that specific elements were injected" ); + start(); + }); + }); + asyncTest( "jQuery.fn.load( String, Function ) - simple: inject text into DOM", 2, function() { jQuery("#first").load( url("data/name.html"), function() { ok( /^ERROR/.test(jQuery("#first").text()), "Check if content was injected into the DOM" ); -- cgit v1.2.3