开发者

why is this Jquery function not working

开发者 https://www.devze.com 2023-01-28 09:06 出处:网络
http://jsfiddle.net/bDSW9/ 开发者_Python百科 In the Above link When i use with \"click\" it is working and when i use it with \"bind\" it is not working .What might be the problem .How can i make it

http://jsfiddle.net/bDSW9/ 开发者_Python百科

In the Above link When i use with "click" it is working and when i use it with "bind" it is not working .What might be the problem .How can i make it work with bind too


jQuery bind takes a function pointer as the second parameter. You should use

$("#imgSaveComment").bind("click",checkParams);

because in your example you call the function checkParams and use the return value to bind to the on click event.


You're missing an element with id "imgSaveComment" and you don't need to use () in the function part of .bind

.bind("click",checkParams);

http://jsfiddle.net/bDSW9/5/

0

精彩评论

暂无评论...
验证码 换一张
取 消