MENU
Others
$.error(String msg)<br>Throws an exception.$.readyException(error)<br>Handles errors thrown synchronously in functions wrapped in $(document).ready() or equivalent.$.globalEval(String code)<br>Similar to eval() in JavaScript except that $.globalEval(...) executes the code within the global context.<br>$.noop()<br>A dummy function that does nothing. It is used to be passed as a callback when nothing needs to be done.<br>$.now()<br>Return a number representing the current time. It is a shorthand for (new Date).getTime().<br>
RESETRUNFULL
RESETRUNFULL
<!doctype html><html><head>
<script src="jquery-3.5.1.min.js"></script></head><body> <p><button type="button" id="test">Test</button></p><div id="log"></div> <script>var me = {
type: "zombie",
test: function( event ) { // Without proxy, `this` would refer to the event target // use event.target to reference that element.
var element = event.target;
$( element ).css( "background-color", "red" ); // With proxy, `this` refers to the me object // encapsulating this function.
$( "#log" ).append( "Hello " + this.type + "<br>" );
$( "#test" ).off( "click", this.test );
}}; var you = {
type: "person",
test: function( event ) {
$( "#log" ).append( this.type + " " );
}}; // Execute you.test() in the context of the `you` object// no matter where it is called// i.e. the `this` keyword will refer to `you`var youClick = $.proxy( you.test, you ); // attach click handlers to #test$( "#test" ) // this === "zombie"; handler unbound after first click
.on( "click", $.proxy( me.test, me ) ) // this === "person"
.on( "click", youClick ) // this === "zombie"
.on( "click", $.proxy( you.test, me ) ) // this === "<button> element"
.on( "click", you.test );</script> </body></html>
Passing the received error to console.error.
RESETRUNFULL
RESETRUNFULL
jQuery.readyException = function( error ) {
console.error( error );};