[jQuery] Re: 1.2.4 to 1.2.6 question
It was that other post that jogged my memory as well. Yes, I have an older version of prototype and scriptaculous on that site, but there is really no point for me to upgrade that with any potential problems with it. The plan is to eventually convert that autocomplete anyway. I'm debating on how long to wait. I've used Jörn's script, but now they're converting it to use with UI. They've made some pretty significant changes to the code and until the documentation catches up, I'm not sure what I'd have to change in my stuff. So do I convert now to the version of Jörn's script that I have or wait until it's fully complete for the next UI version? For now, I'm just pointing to jQuery 1.2.4 which isn't having the conflict with prototype. On Jul 8, 8:40 pm, Karl Swedberg <[EMAIL PROTECTED]> wrote: > Hi Shelane, > > I just had major issues today adding some jQuery (1.2.6) to an old > site that has legacy Prototype code. This has come up a few times > before on the list, but I totally forgot about that while I was in the > midst of my agony. If I recall correctly, the conflict only occurs > with certain versions of Prototype. > > I got around my particular issue by calling the same function > separately on two IDs instead of calling it just once with both IDs in > a single selector. Maybe Prototype is doing something funky to the > arrays that jQuery selectors build? I don't know. > > I wonder if Ariel's suggestion from a previous post on the dev list -- > "If you upgrade Scriptaculous to 1.8.1, it should work well" -- would > apply here as well. > > > > Aha! Michael Geary explains it here: [1] > > > > > Your page is loading script.aculo.us effects.js v1.7.1_beta3. This > > file > > defines Array.prototype.call as a function. > > > That causes massive confusion inside jQuery 1.2.6, but not in 1.2.3. > > The > > reason is the change that was made to jQuery's makeArray() function > > in 1.2.6 > > - if the code is passed an array that has a call method, it mistakenly > > thinks it is not an array and does the wrong thing - line 1135 of > > jquery-1.2.6.js is the pertinent code here. (The correct fix isn't > > immediately obvious, but I'll file a ticket on this.) > > > As it happens, the current version of script.aculo.us effects.js, > > v1.8.1, no > > longer defines Array.prototype.call. > > [1]http://groups.google.com/group/jquery-en/browse_thread/thread/5a83b3b... > > Anyway, thanks for jogging my memory with your post. Maybe I'll > revisit my code in the morning and see if I can upgrade prototype and > get a less hacky solution going. > > --Karl > > Karl Swedbergwww.englishrules.comwww.learningjquery.com > > On Jul 8, 2008, at 5:27 PM, Shelane wrote: > > > > > It looks like the problem has to do with me still having prototype on > > the page. It's the first jQuery site I ever did and the autocomplete > > plugin wasn't far enough along for me to use at that point. I've > > pointed to an older version of jQuery until I get around to rewriting > > that page to use the jQuery autocomplete. > > > On Jul 8, 1:39 pm, Shelane Enos <[EMAIL PROTECTED]> wrote: > >> I just found out that this function that worked (doubled checked to > >> confirm) > >> worked under 1.2.4 but isn't working under 1.2.6. I'm not sure > >> what. Can > >> anyone see anything obvious? > > >> bindDeleteLinks = function(who){ > >>$("a.rembtn", '#' + who).unbind('click'); > >>$("a.rembtn", '#' + who).click(function(){ > >>console.log('bound and clicked ' + who); > >>$(('#' + this.id + 'row')).css({display:'none'}); > >>$.get('includes/tools/runtime.lasso?task=meetings&who=' > >> + who + > >> '&method=remove&pageID=' + pageID + '&rel=' + this.id); > >>return false; > >>}); > >>} > > >> Under 1.2.6, the console message doesn't even show.
[jQuery] Re: 1.2.4 to 1.2.6 question
Hi Shelane, I just had major issues today adding some jQuery (1.2.6) to an old site that has legacy Prototype code. This has come up a few times before on the list, but I totally forgot about that while I was in the midst of my agony. If I recall correctly, the conflict only occurs with certain versions of Prototype. I got around my particular issue by calling the same function separately on two IDs instead of calling it just once with both IDs in a single selector. Maybe Prototype is doing something funky to the arrays that jQuery selectors build? I don't know. I wonder if Ariel's suggestion from a previous post on the dev list -- "If you upgrade Scriptaculous to 1.8.1, it should work well" -- would apply here as well. Aha! Michael Geary explains it here: [1] Your page is loading script.aculo.us effects.js v1.7.1_beta3. This file defines Array.prototype.call as a function. That causes massive confusion inside jQuery 1.2.6, but not in 1.2.3. The reason is the change that was made to jQuery's makeArray() function in 1.2.6 - if the code is passed an array that has a call method, it mistakenly thinks it is not an array and does the wrong thing - line 1135 of jquery-1.2.6.js is the pertinent code here. (The correct fix isn't immediately obvious, but I'll file a ticket on this.) As it happens, the current version of script.aculo.us effects.js, v1.8.1, no longer defines Array.prototype.call. [1] http://groups.google.com/group/jquery-en/browse_thread/thread/5a83b3b23e38a6a7/5a91e47087a1555e?hl#msg_c63cabcb38ffcb8b Anyway, thanks for jogging my memory with your post. Maybe I'll revisit my code in the morning and see if I can upgrade prototype and get a less hacky solution going. --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Jul 8, 2008, at 5:27 PM, Shelane wrote: It looks like the problem has to do with me still having prototype on the page. It's the first jQuery site I ever did and the autocomplete plugin wasn't far enough along for me to use at that point. I've pointed to an older version of jQuery until I get around to rewriting that page to use the jQuery autocomplete. On Jul 8, 1:39 pm, Shelane Enos <[EMAIL PROTECTED]> wrote: I just found out that this function that worked (doubled checked to confirm) worked under 1.2.4 but isn't working under 1.2.6. I'm not sure what. Can anyone see anything obvious? bindDeleteLinks = function(who){ $("a.rembtn", '#' + who).unbind('click'); $("a.rembtn", '#' + who).click(function(){ console.log('bound and clicked ' + who); $(('#' + this.id + 'row')).css({display:'none'}); $.get('includes/tools/runtime.lasso?task=meetings&who=' + who + '&method=remove&pageID=' + pageID + '&rel=' + this.id); return false; }); } Under 1.2.6, the console message doesn't even show.
[jQuery] Re: 1.2.4 to 1.2.6 question
It looks like the problem has to do with me still having prototype on the page. It's the first jQuery site I ever did and the autocomplete plugin wasn't far enough along for me to use at that point. I've pointed to an older version of jQuery until I get around to rewriting that page to use the jQuery autocomplete. On Jul 8, 1:39 pm, Shelane Enos <[EMAIL PROTECTED]> wrote: > I just found out that this function that worked (doubled checked to confirm) > worked under 1.2.4 but isn't working under 1.2.6. I'm not sure what. Can > anyone see anything obvious? > > bindDeleteLinks = function(who){ > $("a.rembtn", '#' + who).unbind('click'); > $("a.rembtn", '#' + who).click(function(){ > console.log('bound and clicked ' + who); > $(('#' + this.id + 'row')).css({display:'none'}); > $.get('includes/tools/runtime.lasso?task=meetings&who=' + who + > '&method=remove&pageID=' + pageID + '&rel=' + this.id); > return false; > }); > } > > Under 1.2.6, the console message doesn't even show.