mirror of
https://github.com/jquery/jquery.git
synced 2025-01-10 18:24:24 +00:00
parent
f4b37d8982
commit
2df1aad6a1
@ -51,8 +51,9 @@ jQuery.extend({
|
|||||||
readyList.resolveWith( document, [ jQuery ] );
|
readyList.resolveWith( document, [ jQuery ] );
|
||||||
|
|
||||||
// Trigger any bound ready events
|
// Trigger any bound ready events
|
||||||
if ( jQuery.fn.trigger ) {
|
if ( jQuery.fn.triggerHandler ) {
|
||||||
jQuery( document ).trigger("ready").off("ready");
|
jQuery( document ).triggerHandler( "ready" );
|
||||||
|
jQuery( document ).off( "ready" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
24
test/data/core/onready.html
Normal file
24
test/data/core/onready.html
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
|
||||||
|
<title>alias-masked DOM properties (#14074)</title>
|
||||||
|
<script>
|
||||||
|
var error = false;
|
||||||
|
window.onready = function() { error = "Called window.onready"; };
|
||||||
|
</script>
|
||||||
|
<script src="../../jquery.js"></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<form>
|
||||||
|
<input type="text" id="nodeName"/>
|
||||||
|
</form>
|
||||||
|
<script>
|
||||||
|
jQuery(function() {
|
||||||
|
setTimeout( function() {
|
||||||
|
window.parent.iframeCallback( error );
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -1516,3 +1516,10 @@ testIframeWithCallback( "Tolerating alias-masked DOM properties (#14074)", "core
|
|||||||
deepEqual( errors, [], "jQuery loaded" );
|
deepEqual( errors, [], "jQuery loaded" );
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
testIframeWithCallback( "Don't call window.onready (#14802)", "core/onready.html",
|
||||||
|
function( error ) {
|
||||||
|
expect( 1 );
|
||||||
|
equal( error, false, "no call to user-defined onready" );
|
||||||
|
}
|
||||||
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user