Using jQuery check if the callbacks have already been called at least once
- جي كويري
- 2021-09-17
- mhanasmh00489829403
الأجوبة
HTML Code :
<!DOCTYPE html>
<html>
<head>
<script src="https://code.jquery.com/jquery-git.js"></script>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Using jQuery check if the callbacks have already been called at least once.</title>
</head>
<body>
</body>
</html>
JavaScript Code :
// A sample function f1
var f1 = function( value ) {
console.log( "f1:" + value );
};
var callbacks = $.Callbacks();
// Add the function "f1" to the list
callbacks.add(f1);
// Fire the items on the list
callbacks.fire("JavaScript" );
callbacks.fire( "jquery" );
// Test if the callbacks have been called
console.log( callbacks.fired() );
أسئلة مشابهة
القوائم الدراسية التي ينتمي لها السؤال
معلومات ذات صلة