off = url.indexOf(" ");
if ( off >= 0 ) {
- selector = url.slice( off );
+ selector = jQuery.trim( url.slice( off ) );
url = url.slice( 0, off );
}
<div class="user">This is a user</div>
<div class="user">This is a user</div>
<div class="teacher">This is a teacher</div>
+<div id="superuser">This is a superuser</div>
});
});
+ // 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" );