Uncaught TypeError: Object #<Document> has no method 'load'
来源:互联网 发布:powershell ssh linux 编辑:程序博客网 时间:2024/06/05 21:18
当Javascript加载XML文件时,IE和FF下正常,但Chrome下报错:Uncaught TypeError: Object #<Document> has no method 'load' ,这是因为Chrome浏览器没有实现XMLdocument.load方法,你可以换成XmlHttpRequest
var xmlDoc = "";try{ //Internet Explorer xmlDoc=new ActiveXObject("Microsoft.XMLDOM"); xmlDoc.async=false; xmlDoc.load(file);}catch(e){ try{ //Firefox, Mozilla, Opera, etc. xmlDoc=document.implementation.createDocument("","",null); xmlDoc.async=false; xmlDoc.load(file); }catch(e){ try{ //Google Chrome var xmlhttp = new window.XMLHttpRequest(); xmlhttp.open("GET",file,false); xmlhttp.send(null); xmlDoc = xmlhttp.responseXML.documentElement; }catch(e){ error=e.message; } }}
0 0
- Uncaught TypeError: Object #<Document> has no method 'load'
- Uncaught TypeError: Object [object Object] has no method 'live'
- jquery: Uncaught TypeError: Object [object Object] has no method 'live'
- Uncaught TypeError: Object [object Object] has no method 'xxx'
- Uncaught TypeError: Object [object Object] has no method 'highcharts'
- Uncaught TypeError: Object #<Object> has no method 'addEvents'
- Uncaught TypeError: Object #<Object> has no method 'addEvents'
- ztree “Uncaught TypeError: Object # has no method 'toLowerCase'”
- Uncaught TypeError: Object #<HTMLDivElement> has no method 'attr'
- Uncaught TypeError: Object #<HTMLCollection> has no method 'toLowerCase'问题
- jquery dialog异常 Uncaught TypeError: Object [object Object] has no method 'dialog'
- [Android] Web Console: Uncaught TypeError: Object [object Object] has no method 'xxx'
- sencha touch中出现JS错误Uncaught TypeError: Object [object Object] has no method 'getForm'
- Uncaught TypeError: Object [object Object] has no method 'live' 报错
- 安卓WebView报错:android uncaught typeerror object object object has no method
- Android js交互错误:Uncaught TypeError: Object [object Object] has no method 'xxx'
- 【Android】Web Console: Uncaught TypeError: Object [object Object] has no method 'xxx'
- [Android] Web Console: Uncaught TypeError: Object [object Object] has no method 'xxx'
- (六)Brute-Force算法与KMP算法
- testaaaaaaaaaaaa
- Android 双击返回键退出程序 实现
- 杨辉三角形
- wince对中文字体的支持
- Uncaught TypeError: Object #<Document> has no method 'load'
- 什么情况下可报名参加广州传智播客.Net就业班培训
- Easymock之初见
- poj 3281 Dining (最大流Dinic)
- PreparedStatement
- WinCE内核裁减(中文字体)及字库和内核的分离
- iOS----NSTimer的使用小结
- 广州传智播客—其实女生学PHP很拉风
- 你在找牛逼的Java培训机构吗,来广州传智播客吧