| By Coach Wei | Article Rating: |
|
| December 2, 2007 12:30 PM EST | Reads: |
11,350 |
Coach Wei's BlogI spent some time playing with Bob Buffone's newest work on Ajax over the last few days. Bob built an xModify processor that runs on either jQuery, Dojo or Mootools. The xModify processor is powerful but quite lightweight (10KB without gzip). There will be more news on xModify but that is not the point of this post. Anyway, I wrote a little app that uses his stuff. The entire application uses three JavaScript file: jQuery library (70KB), xModify processor (10KB) and my little JavaScript file (2KB).
My target is to run the little app on Internet Explorer and FireFox. In particular, I have used FireBug on FireFox during development. FireBug is a popular FireFox browser add-on that provides JavaScript debugging capability. After a little while, without a lot of effort (thanks to FireBug, jQuery and xModify), my app is working. It does exactly what I intended. Flawlessly.
Then I applied a modified version of ShinkSafe, reducing the number of round trips as well as download size. ShrinkSafe is a tool provided by Dojo that compresses JavaScript files. Using ShrinkSafe, the three JavaScript files are combined into one and the total download footprint also reduced by about 30% to 40%. The result worked well on both IE and FireFox. At this point, I happily concluded my little project and moved onto my day job of web browsing.
However, it turns out that my browsing experience is unusually slow at this moment. Eventually I realized it is because I have my FireBug turned on due to my earlier little project. After I disabled FireBug, web browsing resumed its normal performance.
A few hours later when I tried to run my little application again, it surprisingly failed on FireFox. The app loads into FireFox, but it does not respond to any user interaction. It is not frozon or dead, as I can still type into text fields. It looks fine too as the UI is still rendered correctly. But it is just not responding to any event such as "submit" or "click". On IE, the application is still working fine. The only thing that's changed is that I have FireBug disabled now. Would disabling FireBug break my app? Hard to imagine. Nevertheless, I re-enabled FireBug. Surprisingly the application is working again. If I disable FireBug, the application stops working. So does disabling FireBug actually break my application?
There is one error message on the JavaScript console: Error: uncaught exception: [Exception... "Not enough arguments" nsresult: "0x80570001 (NS_ERROR_XPC_NOT_ENOUGH_ARGS)" location: "JS frame :: http://localhost:1000/app/javascript/jquery/all.js :: anonymous :: line 1" data: no]
What does the error message mean? Where does the error come from?
My natural intuition is that my modified ShrinkSafe is the trouble maker here. It may have screwed up one or two characters when compressing jQuery, xModify or my own JavaScript code. For example, it may have incorrectly removed a ";" from the JavaScript source. IE browser and FireFox with FireBug turned on are able to handle this issue but FireFox without FireBug is not able to interpret JavaScript statements with a missing ";".
Well, now enters a four-hour exciting debugging session....
After four hours, I finally figured out the problem. It is not FireBug. It is not ShrinkSafe. It is actually a coding issue in my little JavaScript code. In my code, I used "XmlHttpRequest" object. Here is the code snippet:
if (window.XMLHttpRequest) req = new XMLHttpRequest();
else if (window.ActiveXObject)
req = new ActiveXObject((navigator.userAgent.toLowerCase().indexOf('msie 5') != -1) ? "Microsoft.XMLHTTP" : "Msxml2.XMLHTTP");
req.open("GET", url, false);
req.send();
The problem is the "req.send()" statement. When you call "send()" method for an XHR object, FireFox expects an argument for this method, even if it is "null". Without an argument, FireFox throws the above exception. Once I changed "req.send();" to "req.send(null);", the problem went away.
The strange thing is that that code works fine on IE, further, works fine on FireFox if FireBug is enabled. In a typical development environment where FireBug is enabled, the problem is never exposed. And then, in a production environment where FireBug is disabled, you get an error. But the message says "Error: uncaught exception: [Exception... "Not enough arguments" nsresult: "0x80570001 (NS_ERROR_XPC_NOT_ENOUGH_ARGS)" location: "JS frame :: http://localhost:1000/app/javascript/jquery/all.js :: anonymous :: line 1" data: no]".
Can the message be any more esoteric?
Happy coding!
Published December 2, 2007 Reads 11,350
Copyright © 2007 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
More Stories By Coach Wei
Coach Wei is the Founder and Chairman of Nexaweb (www.nexaweb.com), developers of the leading software platform for building and deploying Web 2.0 and AJAX applications. Previously, he played a key role at EMC Corporation in the development of a new generation of storage network management software. Wei has his master's degree from MIT, holds several patents, is the author of several technology publications including JDJ, Web 2.0 Journal, and AJAXWorld Magazine, and is an industry advocate for the proliferation of open standards.
![]() |
God 12/01/07 11:34:26 AM EST | |||
Browser security may differ for opening the pages from local or Internet. Use Opera. |
||||
![]() |
God 12/01/07 11:30:50 AM EST | |||
Browser security may differ for opening the pages from local or Internet. Use Opera. |
||||
![]() |
Unknown 11/30/07 10:09:46 AM EST | |||
If "God" doesn't like being in the title he can remove it himself. |
||||
![]() |
Unknown 11/30/07 09:33:54 AM EST | |||
Like ate article. Did you have to use God's name though in the title. |
||||
![]() |
Nexaweb News Desk 11/21/07 10:06:07 AM EST | |||
People say Ajax is hard...and this may be why. I spent some time playing with Bob Buffone's newest work on Ajax over the last few days. Bob built an xModify processor that runs on either jQuery, Dojo or Mootools. The xModify processor is powerful but quite lightweight (10KB without gzip). There will be more news on xModify but that is not the point of this post. Anyway, I wrote a little app that uses his stuff. The entire application uses three JavaScript file: jQuery library (70KB), xModify processor (10KB) and my little JavaScript file (2KB). |
||||
- Kindle 2 vs Nook
- Cloud Computing on Gartner's Top 10 List and SYS-CON Events' 2010 Calendar
- Confessions of a Ulitzer Addict
- IBM Hardware Chief, Intel VC Exec Arrested in Insider Trading Scam
- Tactical Cloud Computing Panel at 1st Annual GovIT Expo
- Ulitzer.com Named Exclusive "New Media" Sponsor of Cloud Computing Conference & Expo
- Moving Your RIA Apps into the Cloud: Seven Challenges
- Adobe’s Aiming ColdFusion at Multiple Clouds
- Windows 7 – Microsoft’s First Step to the Cloud
- Ulitzer Provides a Powerful Social Journalism Platform
- Jill Tummler Singer, Deputy CIO of CIA, Keynotes at GovIT Expo
- Open Source Mobile Cloud Sync and Push Email
- Kindle 2 vs Nook
- The Difference Between Web Hosting and Cloud Computing
- Cloud Computing on Gartner's Top 10 List and SYS-CON Events' 2010 Calendar
- Ajax in RichFaces 3.3, JSF 2 and RichFaces 4
- Confessions of a Ulitzer Addict
- IBM Hardware Chief, Intel VC Exec Arrested in Insider Trading Scam
- My Thoughts on Ulitzer
- Tactical Cloud Computing Panel at 1st Annual GovIT Expo
- Ulitzer.com Named Exclusive "New Media" Sponsor of Cloud Computing Conference & Expo
- US Post Office Hops a Ride on NetSuite’s Cloud
- Moving Your RIA Apps into the Cloud: Seven Challenges
- Adobe’s Aiming ColdFusion at Multiple Clouds
- Building a Drag-and-Drop Shopping Cart with AJAX
- What Is AJAX?
- Google Maps! AJAX-Style Web Development Using ASP.NET
- Flashback to January 2006: Exclusive SYS-CON.TV Interviews on "OpenAjax Alliance" Announcement
- AJAXWorld Conference & Expo to Take Place October 2-4, 2006, at the Santa Clara Convention Center, California
- AJAX Sponsor Webcasts Are Now Available at AJAXWorld Website
- How and Why AJAX, Not Java, Became the Favored Technology for Rich Internet Applications
- "Real-World AJAX" One-Day Seminar Arrives in Silicon Valley
- AJAXWorld University Announces AJAX Developer Bootcamp
- AJAX Support In JadeLiquid WebRenderer v3.1
- Where Are RIA Technologies Headed in 2008?
- Struts Validations Framework Using AJAX




































