2011-06-01 80 views
0

每當我嘗試在谷歌瀏覽器中查看我的網頁時,我都會得到:爲什麼此Javascript與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(空)」

+2

推出鉻'跨起源請求只支持HTTP' - 人體工程學沒有本地系統文件訪問和無HTTPS訪問。 – 2011-06-01 18:12:51

回答

0

的行爲是由設計。可能的解決方案在chromium issue 47416中討論。

當前唯一的解決方法是使用--allow-文件訪問從檔案

相關問題