简体   繁体   中英

validator undefined

I used jQuery validator and bound it to a click event like this :

var validator = $("#formId").data('validator');

When I click the first time I load the page I get the error "validator undefined", but when I refresh the same page it starts working.

any ideas?

找到了答案:我使用jQuery mobile,必须像这样关闭ajax:

$.mobile.ajaxEnabled = false;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM