How to call regular JS function with params within jQuery ?
- by Kim
Is there another way to run a regular JS function with params passed than what I use below ?
It seems redundant use a on-the-way function to do this.
function regularJSfunc(param1,param2) {
// do stuff
}
$(document).ready(function(){
$('#myId').change(function(){
regularJSfunc('data1','data2');
});
}
Using a .bind event seems much better, however I am not sure how to access the params.
Note: Example below doesnt work.
$(document).ready(function(){
$('#myId').bind('change',{'data1','data2'},regularJSfunc);
}