在谷歌瀏覽器里li加載不出來,跨域問題求解決,怎么改
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
? ? <head>
? ? ? ? <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
? ? ? ? <title>使用load()方法異步請求數(shù)據(jù)</title>
? ? ? ? <script src="http://libs.baidu.com/jquery/1.9.0/jquery.js" type="text/javascript"></script>
? ? ? ? <style type="text/css">
? ? ? ? ? ? #divtest
{
? ? width: 282px;
}
#divtest .title
{
? ? padding: 8px;
? ? background-color:Blue;
? ? color:#fff;
? ? height: 23px;
? ? line-height: 23px;
? ? font-size: 15px;
? ? font-weight: bold;
}
ul
{
? ? float: left;
? ? width: 280px;
? ? padding: 5px 0px;
? ? margin: 0px;
? ? font-size: 14px;
? ? list-style-type: none;
}
img
{
? ? margin: 8px;
}
ul li
{
? ? float: left;
? ? width: 280px;
? ? height: 23px;
? ? line-height: 23px;
? ? padding: 3px 8px;
}
.fl
{
? ? float: left;
}
.fr
{
? ? float: right;
}
? ? ? ? </style>
? ? </head>
? ??
? ? <body>
? ? ? ? <div id="divtest">
? ? ? ? ? ? <div class="title">
? ? ? ? ? ? ? ? <span class="fl">我最愛吃的水果</span>?
? ? ? ? ? ? ? ? <span class="fr">
? ? ? ? ? ? ? ? ? ? <input id="btnShow" type="button" value="加載" />
? ? ? ? ? ? ? ? </span>
? ? ? ? ? ? </div>
? ? ? ? ? ? <ul></ul>
? ? ? ? </div>
? ? ? ??
? ? ? ? <script type="text/javascript">
? ? ? ? ? ? $(function () {
? ? ? ? ? ? ? ? $("#btnShow").bind("click", function () {
? ? ? ? ? ? ? ? ? ? var $this = $(this);
? ? ? ? ? ? ? ? ? ? $("ul")
? ? ? ? ? ? ? ? ? ? .html("<img src='Images/Loading.gif' alt=''/>")
? ? ? ? ? ? ? ? ? ? .load("http://idcbgp.cn/data/fruit_part.html",function(){
? ? ? ? ? ? ? ? ? ? ? ? $this.attr("disabled", "true");
? ? ? ? ? ? ? ? ? ? });
? ? ? ? ? ? ? ? })
? ? ? ? ? ? });
? ? ? ? </script>
? ? </body>
</html>
2016-07-15
主要還是熟悉語言創(chuàng)造者發(fā)明的游戲規(guī)則。
2016-04-11
我只直到和服務(wù)器有關(guān),你在本地寫,本地并沒有寫服務(wù)端代碼,這個教程太簡略跨越性太大了...我也搞不懂,
XMLHttpRequest cannot load ? 好像跨域了,在慕課網(wǎng)哪個題里可以加載到,換到本地就加載不到了,我覺得是這樣,看其他人怎么說吧,這后面的教程看得我一頭霧水.....