[FIX] website: ace: client side add a try catch to DOMParser for IE
bzr revid: chm@openerp.com-20140221100853-50smr3ii8jrcq178
This commit is contained in:
parent
d5106a4d34
commit
960ac4bca8
|
@ -39,9 +39,15 @@
|
||||||
this.xml = text;
|
this.xml = text;
|
||||||
},
|
},
|
||||||
isWellFormed: function () {
|
isWellFormed: function () {
|
||||||
|
var error;
|
||||||
if (document.implementation.createDocument) {
|
if (document.implementation.createDocument) {
|
||||||
var dom = new DOMParser().parseFromString(this.xml, "text/xml");
|
// use try catch for ie
|
||||||
var error = dom.getElementsByTagName("parsererror");
|
try {
|
||||||
|
var dom = new DOMParser().parseFromString(this.xml, "text/xml");
|
||||||
|
error = dom.getElementsByTagName("parsererror");
|
||||||
|
} catch (e) {
|
||||||
|
error = e;
|
||||||
|
}
|
||||||
return error.length === 0 || error;
|
return error.length === 0 || error;
|
||||||
} else if (window.ActiveXObject) {
|
} else if (window.ActiveXObject) {
|
||||||
// TODO test in IE
|
// TODO test in IE
|
||||||
|
|
Loading…
Reference in New Issue