prototype and jquery conflict

Discussion in 'jQuery' started by computerzworld, Oct 16, 2008.

  1. #1
    Hello,
    I am using prototype.js for autocompleting fields and jquery for thickbox environment. But if I try to include both in my HTML page then only one is working. I searched on the net and I got this solution from jquery website.

    http://docs.jquery.com/Using_jQuery_with_Other_Libraries

    But it also doesn't worked for me.

    Please help me if anybody is having solution of it

    Thanks in advance.
     
    computerzworld, Oct 16, 2008 IP
  2. dimitar christoff

    dimitar christoff Active Member

    Messages:
    882
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    90
    #2
    heh, this represents everything that's wrong in grabbing scripts from all over the net... there are probably a very few instances where somebody NEEDS to use two frameworks to do anything, let alone for such trivial use as the one you employ them for. probably not what you want to hear but really - pick one and then fine an equivalent of the ajax completer for jquery or just use lightbox (oh yes, you can use the original lightbox based on scriptaculous/prototype).

    as for compatibility with other frameworks, seems that JQ do a fine job of namespacing everything beind "jQuery" - you need to be more specific on the conflict / way in which it does not work.

    you can start by giving a working url, then installing firebug (www.getfirebug.com) for firefox and generally seeing exactly why the failure. javascript is a funny language like that, you can overwrite ANY namespace, including the built in ones. I could do "var alert = function(what) { console.log(what); };" and replace the original one - in this example, it won't have serious repercussions, but you get the idea.

    There are two types of frameworks - those that try to stay out of the way (like YUI, GWT) by namespacing everything and those that don't (like mootools) that try to extend/build upon the native js methods. there are arguments for and against each approach that should be taken into consideration when you pick your framework - some prefer shorthand and ease of use/flow, others prefer compatibility. jQuery tries to do both - which is one of the reasons that it is popular. not sure how well, though :)
     
    dimitar christoff, Oct 16, 2008 IP
    computerzworld likes this.
  3. computerzworld

    computerzworld Active Member

    Messages:
    214
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    58
    #3
    thanks very much for the great info... reps added...:)
     
    computerzworld, Oct 16, 2008 IP
  4. shijobaby

    shijobaby Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    http://htmlerror-info.blogspot.com/2009/12/prototypejs-in-lightbox-or-thickbox.html
     
    shijobaby, Dec 9, 2009 IP