InterviewSolution
Saved Bookmarks
| 1. |
Explain The Use Of The $.fn.bind And $.fn.trigger? |
|
Answer» Both the $.fn.bind and $.fn.triggers are two important jquery METHODS. They are primarily used with CUSTOM events.
Example: depicting the usage of $.fn.bind and $.fn.triggers using custom data in both the cases: $(DOCUMENT).bind('myCustomEvent',{foo:'bar'}, function(e, arg1, ARG2) { console.log(e.data.foo); // 'bar' console.log(arg1); // 'bim' console.log(arg2); // 'baz' }); $(document).trigger('myCustomEvent',['bim','baz']);Both the $.fn.bind and $.fn.triggers are two important jquery methods. They are primarily used with custom events. Example: depicting the usage of $.fn.bind and $.fn.triggers using custom data in both the cases: |
|