可能重複:
Circumventing Chrome Access-control-allow-origin on the local file system?
我的問題是非常簡單的,我使用$就功能來讀取一個CSV文件和代碼工作FF和IE9,但不是在Chrome ...
<!DOCTYPE html>
<html lang="en">
<head>
<script src="http://code.jquery.com/jquery-1.8.2.min.js">
</script>
<script type="text/javascript">
$(document).ready(function() {
$.ajax({
type: "GET",
url: "autorating.csv",
contentType: "text/csv",
success: function(data) {alert('asdsa');}
});
});
</script>
<title>Untitled Document</title>
</head>
<body>
</body>
</html>
任何幫助將明顯.. 謝謝
腳本控制檯說什麼?任何錯誤報告? –
也console.log(數據)在您的成功處理程序和瀏覽器之間進行比較。 –
XMLHttpRequest無法加載file:/// F:/shane/autorating.csv。 Access-Control-Allow-Origin不允許Origin null。 –