InterviewSolution
| 1. |
How To Write A Callback Function With Arguments In Jquery? |
|
Answer» The below code is correct for call back USING arguments $.GET(''samplepage.html'', FUNCTION(){ sampleCallBackFunction(arg1, arg2); }); where get is parent function and sampleCallBackFunction is call back function Howevwer if you will do LIKE below it will not work: $.get(''samplepage.html'', sampleCallBackFunction(arg1, arg2)); The below code is correct for call back using arguments $.get(''samplepage.html'', function(){ sampleCallBackFunction(arg1, arg2); }); where get is parent function and sampleCallBackFunction is call back function Howevwer if you will do like below it will not work: $.get(''samplepage.html'', sampleCallBackFunction(arg1, arg2)); |
|