XMLHttpRequest cannot load file:///D:/work/ Or...

google瀏覽器訪問jason文件出現Origin null is not allowed by Access-Control-Allow-Origin. 讓chrome支持本地Ajax請求通常狀況下,在chrome中運行一些含Ajax請求的界面原型時,會拋出下面錯誤:XMLHttpRequest cannot load file:///D:/eclipse/workspace/uiTest/WebContent/table1.html. Origin null is not allowed by Access-Control-Allow-Origin.從網上看到了解決辦法,記下來以備忘:給chrome加上啓動參數:--allow-file-access-from-files就能夠了(須要關閉全部chrome窗口重啓瀏覽器)。
相關文章
相關標籤/搜索