Prev: FAQ Topic - How do I generate a random integer from 1 to n? (2010-04-03)
Next: active (x)html newsgroup?
From: Hans-Georg Michna on 2 Apr 2010 19:51 I had upgraded the jQuery module and forgot to test one of my web pages that uses it. Sure enough, it no longer worked and copped out with a JavaScript error (akin to a Java null pointer exception :-). Had to go through another stint of weaning myself of jQuery and replace all references to it with native JavaScript code. It tends to be easy, because almost all of the stuff I had done with jQuery can pretty easily be done in raw JavaScript just as well. Some pieces of code become a little longer, but usually not really difficult. The code certainly got faster, because for example getDocumentById("xyz") is faster than $("#xyz").get(0). The page, now without jQuery, is at http://winhlp.com/telly/ and turns telephone numbers into words. I have not tried to analyze why the new jQuery version crashed in this page. Guess it doesn't matter much. My impression is that pretty much every non-trivial, JavaScript-rich page that uses jQuery does not survive the latest jQuery upgrade. Hans-Georg
From: David Mark on 2 Apr 2010 20:27 Hans-Georg Michna wrote: > I had upgraded the jQuery module and forgot to test one of my > web pages that uses it. Sure enough, it no longer worked and > copped out with a JavaScript error (akin to a Java null pointer > exception :-). http://wavs.unclebubby.com/wav/TOONS/Bullwinkle/isityour.wav Happens all the time. They are starting to release new versions almost monthly now too (in some bizarre attempt to "keep up" with those rascally browsers I guess). Amazingly, some advocate linking straight to the latest version on the CDN. Auto upgrades! And auto breakages, of course. :) > > Had to go through another stint of weaning myself of jQuery and > replace all references to it with native JavaScript code. Very good idea. And if you happen to have some you've already written... > It > tends to be easy, because almost all of the stuff I had done > with jQuery can pretty easily be done in raw JavaScript just as > well. Especially if you have done it before. There's not much of anything new in jQuery after all. > Some pieces of code become a little longer, but usually > not really difficult. But the overall size is likely much shorter as you lose 70K of jQuery. JFTR, their ludicrous marketing of an uncompressed "development version" and an un-deployable (by sane people anyway) 35K GZIP version is a sham. The one in the middle (which is what goes on the server) is 70K+. That's what matters for comparison to anything other than GZ files (e.g. JS, GIF, WAV, etc.) > The code certainly got faster, because for > example getDocumentById("xyz") is faster than $("#xyz").get(0). And how! :) > > The page, now without jQuery, is at http://winhlp.com/telly/ and > turns telephone numbers into words. I take it didn't do that with the latest jQuery. :) > > I have not tried to analyze why the new jQuery version crashed > in this page. Yes, why bother? You'll end up paying back all of that time you "saved" in spades. It's only the hopelessly indoctrinated (or insane) that don't notice this. > Guess it doesn't matter much. Of course it does. With jQuery your site broke and you would have been stuck trying to debug Resig's delusions if you hadn't had the needed epiphany. > My impression is > that pretty much every non-trivial, JavaScript-rich page that > uses jQuery does not survive the latest jQuery upgrade. Even trivial ones are at risk as they _constantly_ twiddle with their low level logic and interfaces. Hell, they completely changed attr's behavior recently to call other jQuery methods. Of course, they didn't bother to fix the years-old (and well-documented) design mistakes while they were in there. Fancy that. I still can't believe that one guy actually upgraded his jQuery after years of hesitation (and schooling). Could have written and debugged sixty jQuery's in the time he wasted tracking down problems (and trying to convince Resig to fix them). Insanity is doing the same thing over and over and expecting different results. ;) Kudos on the sanity, Hans-Georg. If only more people would get the picture (or at least rent it!) :)
From: Garrett Smith on 2 Apr 2010 23:00 Hans-Georg Michna wrote: > I had upgraded the jQuery module and forgot to test one of my > web pages that uses it. Sure enough, it no longer worked and > copped out with a JavaScript error (akin to a Java null pointer > exception :-). > It would probably help to provide more details. What error message, what the original code was doing. It is either your fault or jquery fault or for all anyone knows, the problem does not exist. > Had to go through another stint of weaning myself of jQuery and > replace all references to it with native JavaScript code. It > tends to be easy, because almost all of the stuff I had done > with jQuery can pretty easily be done in raw JavaScript just as > well. Some pieces of code become a little longer, but usually > not really difficult. The code certainly got faster, because for > example getDocumentById("xyz") is faster than $("#xyz").get(0). > > The page, now without jQuery, is at http://winhlp.com/telly/ and > turns telephone numbers into words. > I think I remember looking at that before. Didn't work with js disabled, FWIRC. > I have not tried to analyze why the new jQuery version crashed > in this page. Guess it doesn't matter much. My impression is > that pretty much every non-trivial, JavaScript-rich page that > uses jQuery does not survive the latest jQuery upgrade. > APIs that use simple interfaces don't break as easily. Fewer variants. Easier to refactor. -- Garrett comp.lang.javascript FAQ: http://jibbering.com/faq/
From: David Mark on 2 Apr 2010 23:34 Garrett Smith wrote: > Hans-Georg Michna wrote: >> I had upgraded the jQuery module and forgot to test one of my >> web pages that uses it. Sure enough, it no longer worked and >> copped out with a JavaScript error (akin to a Java null pointer >> exception :-). >> > > It would probably help to provide more details. And who would that help exactly? > What error message, what > the original code was doing. Why would that matter at this point? As mentioned, the OP came to his senses and dumped jQuery. Problem solved. > > It is either your fault or jquery fault or for all anyone knows, the > problem does not exist. Ludicrous. Changing out a "time-saving" GP script like jQuery should not break your site. It's well known that they change the API every other month to add "cool" new features with little or no care for the tribulations it will put application developers through. And the application developers have little choice but to "upgrade" perpetually as jQuery is written to suit observations of "current" browsers. Of course, such changes usually break yesterday's browsers, so you are damned if you do and damned if you don't (users can't/won't upgrade in perfect sync with the developers expectations). And what do you mean "does not exist?" Do you think the OP imagined the error or is making up stories to smear jQuery?
From: Garrett Smith on 3 Apr 2010 01:55
David Mark wrote: > Garrett Smith wrote: >> Hans-Georg Michna wrote: >>> I had upgraded the jQuery module and forgot to test one of my >>> web pages that uses it. Sure enough, it no longer worked and >>> copped out with a JavaScript error (akin to a Java null pointer >>> exception :-). >>> >> It would probably help to provide more details. > > And who would that help exactly? > The answer to that question is unknown at this point. >> What error message, what >> the original code was doing. > > Why would that matter at this point? As mentioned, the OP came to his > senses and dumped jQuery. Problem solved. > >> It is either your fault or jquery fault or for all anyone knows, the >> problem does not exist. > [anti-jq-propaganda] > > And what do you mean "does not exist?" Do you think the OP imagined the > error or is making up stories to smear jQuery? Did I post that? No, I didn't. The bug is yet unsubstantiated. See also: http://www.jibbering.com/faq/notes/posting/#ps1DontWork -- Garrett comp.lang.javascript FAQ: http://jibbering.com/faq/ |