How do I use the latest version of jQuery and get back the '$' for jQuery in RichFaces?

a 夏天 提交于 2019-12-08 03:43:49

问题


RichFaces 3.3.3 comes baked in with jQuery 1.3.2 and prototype and scriptaculous as well.

How can I try and use the latest version of jQuery? Can I use the Google CDN one?

Also the $() object is defaulted to prorotype and to use jQuery I have to do jQuery()

is there a way to get back the $ for jQuery without breaking RichFaces?

UPDATE: You can use multiple versions of jQuery side by side. For now, I've gone ahead and used the version that comes baked with RichFaces.


回答1:


You can use $ with jQuery without breaking RichFaces by wrapping your jQuery code in this manner:

(function($) {
  /* your jQuery code can use $() here */
})(jQuery);


来源:https://stackoverflow.com/questions/3881953/how-do-i-use-the-latest-version-of-jquery-and-get-back-the-for-jquery-in-ric

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!