Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.5.8

Bug #13113 Opera, JavaScript and XMLSerializer
Submitted: 2008-02-13 15:15 UTC
From: burkon Assigned: jeichorn
Status: Closed Package: HTML_AJAX (version 0.5.3)
PHP Version: 5.2.3 OS: all
Roadmaps: 0.5.3    
Subscription  


 [2008-02-13 15:15 UTC] burkon (Mirek Burkon)
Description: ------------ Opera (9.25, Linux) parses all JavaScript files and declares all the functions, defined in code as "function foo () {/*code*/}", without paying attention to logical structure of code (probably for speed reasons). It also has internal XMLSerializer built in. There is a check of availability of DOMParser.parseFromString && window.ActiveXObject and function XMLSerializer()is created (line 117 in /js/HTML_AJAX.js) if this condition is passed. Due to this (strange) behaviour of Opera, condition is evalued as false but internal function XMLSerializer()always redefined by your empty constructor, which means destroying internal XMLSerializer object (which can no longer be used by other JS scripts). The solution is creating your XMLSerializer by using following syntax on the line 117 of HTML_AJAX.js: XMLSerializer = new function() {/* empty constructor */}; instead of actual: function XMLSerializer() {/* empty constructor */}; Test script: --------------- alert(XMLSerializer); Expected result: ---------------- in Opera you should get: function XMLSerializer() { [native code] } Actual result: -------------- function XMLSerializer() { }

Comments

 [2008-02-15 16:33 UTC] jeichorn (Joshua Eichorn)
Fixed in SVN thanks
 [2008-04-03 08:30 UTC] troehr (Torsten Roehr)
The new syntax (also applied to DOMParser) causes the following JavaScript error in IE6 on Win XP: 'DOMParser' is not defined So obviously this syntax is not recognized by IE6. Please revert to the old syntax or find a syntax that is compatible to both IE6 and Opera. Best regards, Torsten
 [2008-04-03 16:52 UTC] jeichorn (Joshua Eichorn)
I'll do a 0.5.4 release with some sort of fix today
 [2008-04-03 18:11 UTC] jeichorn (Joshua Eichorn)
troehr: i'm not seeing any errors on ie6, do you have an example site where you are seeing the problem
 [2008-04-04 09:46 UTC] troehr (Torsten Roehr)
I tracked it down a bit. The error only occurs within an iframe. If you open iframe.html itself, it's fine. I uploaded two HTML files as test_script.zip.txt. Remove the .txt extension and unzip. Because of the 20K limit per patch I could not include the all_clients.js. It is the generated output from the Ajax server script with client=all. Hope this helps. Thanks for looking into this. Best regards, Torsten
 [2008-04-04 16:34 UTC] jeichorn (Joshua Eichorn)
I've been able to reproduce the problem, I still haven't found a solution but at worst i will roll back to the old version today
 [2008-04-04 21:10 UTC] jeichorn (Joshua Eichorn)
Just uploaded 0.5.4 with a fix