0
我想使用.load()函數加載Jq的公共Google電子表格。試圖.load()一個公共的谷歌電子表格
我在做什麼錯? http://jsbin.com/egetek/edit#javascript,html
$("#success").load("https://docs.google.com/spreadsheet/pub?key=0At4KrD3MMS40dFR0cm1ubGJGNnpnSWJZSVpDckpsWmc&single=true&gid=0&output=html", function(response, status, xhr) {
if (status == "error") {
var msg = "Sorry but there was an error: ";
$("#error").html(msg + xhr.status + " " + xhr.statusText);
}
});
的HTML:
<!DOCTYPE html>
<html>
<head>
<script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<style>
article, aside, figure, footer, header, hgroup,
menu, nav, section { display: block; }
</style>
</head>
<body>
<p id="success"></p>
<div id="error"></div>
</body>
</html>
我同意。下面是一個基本上你在做什麼錯誤處理jsfiddle:http://jsfiddle.net/ufomammut66/xB4B7/ 如果你看看控制檯在鉻 - 給你的訪問控制,允許來源錯誤 – ShortRound1911 2012-03-06 21:13:43