我在加载 jquery 插件依赖项时似乎找不到冲突
我似乎找不到我的 jquery 依赖插件冲突。 CURL.js 每次都能完美加载 jquery 验证插件、jquery 表单插件和 css,而不会在 firebug 中抛出错误。当我单击“提交”按钮时,jquery 表单插件不使用 ajax 提交表单,而是按照以下步骤正常提交:
1)单击“注册”链接
2)单击“购物者”链接并等待其加载
3)单击“商店”链接并等待其加载
4) 再次单击 Shopper 链接并等待其加载
5) 单击提交按钮
步骤也可以反之亦然。
但是,如果我单击其中一个链接而不单击第二个链接,然后按提交按钮,jquery 验证会正确触发;一旦表单通过验证,表单插件就会使用 ajax 提交表单。
演示链接:http://www.dickschicks.net/demo/
请告诉我是否演示链接还不够,您需要更多信息来进一步帮助我。
I cannot seem to find my jquery dependency plugin conflict. CURL.js loads the jquery validation plugin, jquery form plugin and css perfectly every time without throwing errors in firebug. When I click the submit button jquery form plugin does not use ajax to submit the form, instead it submits normally when I follow these steps:
1)Click Register link
2)Click Shopper link and wait for it to load
3)Click Store link and wait for it to load
4)Again click Shopper link and wait for it to load
5)Click the submit button
The steps can be vise versa also.
However, if I click one of the links and do not click the second link, then press the submit button, jquery validation triggers correctly; once the form passes validation the form plugin submits the form using ajax.
Demo link: http://www.dickschicks.net/demo/
Please let me know if the demo link is not enough and that you need more information to further assist me.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
所发生的情况是,每次单击 Shopper 或 Store 链接都会用一组新的 html 替换表单的内容。但只有第一次单击才会加载验证脚本。
因此,当您第二次点击返回 Shopper 时,它不会再次运行您的脚本,并且原始的
#shopperJoinForm
及其验证器已被删除。现在你只有一张空白表格。我真的不明白卷曲应该做什么......但我想的是你将验证调用移动到这样的函数中(这将位于
shopper_validation.js:
然后回到您的
join.js
中,让它检查该函数是否存在,如果存在则调用它,如果不存在,则执行您的curl操作。这
What happens is that each click of the Shopper or Store links replaces the contents of the form with a new set of html. But only the first click of each loads the validation scripts.
So the second time you click back to Shopper, it doesn't run your scripts again, and the original
#shopperJoinForm
and it's validator have been removed. Now you just have a blank form.I don't really understand what the curl thing is supposed to be doing... but what I'm thinking is that you move your validation calls into a function like this (this would be in the
shopper_validation.js
:Then back in your
join.js
, have it check whether that function exists, call it if it does, and if not, do your curl thing.The