开发者

rails using rjs prototype conflict with jQuery

I'm using rails rjs, but I found it doesn't work, when I added "jquer开发者_Python百科y.js" like this

<%= javascript_include_tag :defaults,'jquery.validate.min.js'%>

but when I changed it like this

<%= javascript_include_tag :defaults%>

It works, so weird! any helps? Thanks


Standard rjs works with prototype javascript library which ships with rails by default. When you added javascript_include_tag :defaults, you included this library (look at result html).

You can use remote javascript with JQuery. View this screencast how to do it. The best practice for now is to use unobtrusive javascript. Another screencast on this subject here. And it works not only with rails 3 but with rails 2.3 as well.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜