hey ppl i am coding a new website, i am using the JQUERY UI library. it working perfectly but now i came to dynamic updating the pages using prototype.js when i use prototype.js alone it is fine but when i include the ui library everything goes upside down, i mean everything messes up. is there is anyway that i can use prototype.js with ui without everything goes bad?? please dont tell me to not use ui library couz my main site's layout is made with the UI library. And if there is another library like the prototype.js library and dont messes up the ui style please tell me. any help will be greatly apreaciated!
2 Answers
You can override the $ to any custom symbol you want and use it for jQuery manipulation and leave $ for the conflicting library(prototype.js).
Check this out: http://letmehaveblog.blogspot.com/2006/09/using-prototype-and-jquery-together.html
"$" is basically a short for "jQuery", doing jQuery.noConflict() tells jQuery library to not use $ as the short. so $("#id") can be done as jQuery("#id").
Hope it helps.
Comments
jQuery-UI is built on top of jQuery. Both jQuery and prototype use $ as the name of their main function. Sounds like jQuery and prototype are fighting over $. You could use jQuery instead of prototype or call jQuery.noConflict() to tell jQuery to let go of $ for other things to use.