Mootools 1.11 和 1.2.4 冲突,Ajax.Form
我正在尝试使用 Mootools Ajax.Form,并且能够通过以下方式成功进行测试安装: http://demos111.mootools.net/Ajax.Form
仅当我将 mootools 脚本降级为1.11.对于我网站上的其余内容,我一直使用 1.2.4。
我猜测存在冲突问题......但不确定如何解决这个问题?我对 Ajax.Form 进行了一些搜索,看看其他人是否也遇到这个问题,但到目前为止还没有成功。
任何帮助将不胜感激。谢谢你!
I'm trying to use Mootools Ajax.Form, and was able to make a successful test installation with this:
http://demos111.mootools.net/Ajax.Form
ONLY if I downgraded my mootools script to 1.11. For the rest of the stuff on my site, I've been using 1.2.4.
I'm guessing there's a conflict issue going on...but wasn't sure how to fix this? I did some searching for the Ajax.Form to see if anyone else had this problem, but so far have been unsuccessful.
Any help would be much appreciated. Thank you!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不同之处在于
Element.send
快捷方式在 1.11 和 1.2.x 之间更改了其签名新签名不再接受请求选项作为 .send 方法的一部分,仅接受 URL(以允许在每个请求上覆盖 GET/POST 的 URL)。
使用新的 API,您必须在表单元素上使用
set
方法来设置send
选项,如下所示:您可以查看有关如何使用该元素的完整示例.send 方法在以下小提琴上: http://jsfiddle.net/S3H4G/2/
您可以请参阅官方文档查看当前的Element.send签名,以及Request 对象文档 查看可以在
中传递的所有可用选项>设置
方法。请注意,对于表单,url
、method
和data
参数默认为表单元素当前在 HTML 中设置的内容。The difference is that the
Element.send
shortcut changed it's signature between 1.11 and 1.2.xThe new signature no longer accepts the request options as part of the .send method, only a URL is accepted (to allow overriding the URL to GET/POST to on each request).
With the new API, you have to use the
set
method on the form element to set thesend
options like this:you can see a full example on how to use the Element.send method on the following fiddle: http://jsfiddle.net/S3H4G/2/
You can refer to the official docs to see the current Element.send signature, and the Request object docs to see all the available options you can pass in the
set
method. Do notice that in case of forms, theurl
,method
anddata
parameters default to what the form element currently has set in the HTML.不幸的是,新版本的 Mootools 不向后兼容。但更新旧插件通常很容易。如果这个 Ajax.Form 非常简单,那么只需重新分配 $ 方法即可。
请查看本文的插件部分以获取帮助:
http://mootools.net/blog/2009/06/22/the-dollar-safe-mode/
Unfortunately the newer versions of Mootools are not backward compatible. But it is usually pretty easy to update older plugins. If this Ajax.Form is pretty simple it could just be a matter of reassigning the $ method.
Check out the Plugins section of this article for help:
http://mootools.net/blog/2009/06/22/the-dollar-safe-mode/