【发布时间】:2011-09-06 12:54:57
【问题描述】:
每次我尝试在 Google Chrome 中查看我的网页时,我都会收到以下信息:
XMLHttpRequest 无法加载文件:tickercontent.txt?bustcache=1306951376114。仅 HTTP 支持跨源请求。 ajaxticker.js:63Uncaught 错误:NETWORK_ERR:XMLHttpRequest 异常 101
页面上什么也没有显示。
ajax_ticker.prototype.getXMLfile=function(){
this.ajaxobj=createAjaxObj() //recreate Ajax object (IE seems to require it)
if (this.ajaxobj){
var instanceOfTicker=this
var url=this.xmlfile+"?bustcache="+new Date().getTime()
this.ajaxobj.onreadystatechange=function(){instanceOfTicker.initialize()}
this.ajaxobj.open('GET', url, true)
this.ajaxobj.send(null)
}
}
第 63 行将是“this.ajaxobj.send(null)”
【问题讨论】:
-
Cross origin requests are only supported for HTTP- 因此没有本地系统文件访问权限,也没有 HTTPS 访问权限。
标签: javascript google-chrome syntax-error identifier