#2031 closed defect (fixed)
Errors with xml/Parse.js on IE6 and IE7
Reported by: | luke dot arms at inspiriti dot com dot au | Owned by: | morris |
---|---|---|---|
Priority: | high | Milestone: | 0.9 |
Component: | General | Version: | 0.4.1rc1 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
JavaScript? errors are thrown by the getDojoTagName function in xml/Parse.js, as of 0.4.1rc1 (same bug on earlier versions).
Adding a check for node.scopeName resolves the issue, as below.
=============== 67c67 < if(dojo.render.html.capable && dojo.render.html.ie && node.scopeName != 'HTML'){ ---
if(dojo.render.html.capable && dojo.render.html.ie &&
typeof(node.scopeName) != 'undefined' && node.scopeName != 'HTML'){
===============
Cheers.
Attachments (2)
Change History (10)
comment:1 Changed 14 years ago by
comment:2 Changed 14 years ago by
I presume you mean you need to see some code that fails? (Sorry, this is my first time participating here. Please fill me in if there's anything else I should do to make this easier, as I hope to be more involved.) Ok, here goes:
<script language="javascript" src="../iwaf/php/iwaf/scripts/dojo/dojo.js"></script> <script language="javascript"> dojo.require("dojo.xml.*"); function orgSelected (org) { dojo.io.bind({ url: "../Ajax/Request.php?rid=sql_select_wm_individual&orgkey=" + org, load: processOrgResult, method: "POST", error: function (type, error) { alert("Error processing request for individuals: " + error); }, mimetype: "text/xml" }); } function processOrgResult (type, data, evt) { var parser = new dojo.xml.Parse(); var xml = parser.parseElement(data.getElementsByTagName("response")[0]); ... } ...
orgSelected is triggered by a select box onchange event. The parser.parseElement line fails, even though the XML returned is valid and the "response" element is being looked up correctly. I debugged using Visual Studio and found the failure in the line mentioned originally, because scopeName wasn't defined on the elements.
I'll repost the fix using WikiFormatting:
67c67 < if(dojo.render.html.capable && dojo.render.html.ie && node.scopeName != 'HTML'){ --- > if(dojo.render.html.capable && dojo.render.html.ie && > typeof(node.scopeName) != 'undefined' && node.scopeName != 'HTML'){
Changed 14 years ago by
comment:3 Changed 14 years ago by
Proper test case attached.
Sorry about the description on the XML file ... but I can't fix it :-(
comment:4 Changed 14 years ago by
Hi,
Sorry for the botch-up I've made of this bug report ;-) The next one will be much neater. Meanwhile, just wanted to add that this bug is still a problem in 0.4.1 and the same fix still works.
Cheers.
comment:5 Changed 14 years ago by
Milestone: | → 0.5 |
---|---|
Owner: | changed from anonymous to morris |
comment:6 Changed 14 years ago by
Problem not repeated, but fix is sane and I tested it.
Fixed in 6882.
comment:7 Changed 14 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:8 Changed 14 years ago by
Just confirming that this code is still broken in 0.4.2 even though it appears to have been cleaned up.
I have since read further documentation on comparisons with undefined variables and if my understanding is correct, code like this will break if it is not possible to convert the variable to a string via toString:
if (myUndefinedVar == "something") {
...
}
So this fix is still important. Not sure why it wasn't included in 0.4.2 given it's been fixed for 3 months already ...
I'd appreciate it if someone could assure me that this fix will be included in the next release.
Testcase?