課程
/前端開發(fā)
/jQuery
/jQuery基礎(chǔ)(五)一Ajax應(yīng)用與常用插件
代碼復(fù)制到本地?zé)o法運行怎么解決?怎樣在本地使用load。
2019-07-01
源自:jQuery基礎(chǔ)(五)一Ajax應(yīng)用與常用插件 1-1
正在回答
<!DOCTYPE html >
<html xmlns="http://www.w3.org/1999/xhtml">
? ? <head>
? ? ? ? <title>使用load()方法異步請求數(shù)據(jù)</title>
? ? ? ? <script src="http://idcbgp.cn/static/lib/jquery/1.9.1/jquery.js" type="text/javascript"></script>
? ? ? ? <link href="style.css" rel="stylesheet" type="text/css" />
? ? </head>
? ??
? ? <body>
? ? ? ? <div id="divtest">
? ? ? ? ? ? <div class="title">
? ? ? ? ? ? ? ? <span class="fl">我最愛吃的水果</span>?
? ? ? ? ? ? ? ? <span class="fr">
? ? ? ? ? ? ? ? ? ? <input id="btnShow" type="button" value="加載" />
? ? ? ? ? ? ? ? </span>
? ? ? ? ? ? </div>
? ? ? ? ? ? <ul><h3></h3></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.html",function(){
? ? ? ? ? ? ? ? ? ? ? ? $this.attr("disabled", "true");
? ? ? ? ? ? ? ? ? ? });
? ? ? ? ? ? ? ? })
? ? ? ? ? ? });
? ? ? ? </script>
? ? </body>
</html>
把圖片路徑以及js路勁改好? http改成https
weixin_慕瓜0263649 提問者
舉報
如何用jquery實現(xiàn)ajax應(yīng)用,加入學(xué)習(xí),有效提高前端開發(fā)速度
1 回答為什么復(fù)制到本地,load方法不能用了?跨域了?
3 回答為什么我本地運行不出效果
3 回答報這個錯誤怎么解決?
2 回答ajax load本地頁面,顯示error,找不到這個頁面,是怎么回事?
1 回答post 和 get用的時候php文件是不是都要傳到服務(wù)器上才行?我再本地的文件運行不了
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網(wǎng)安備11010802030151號
購課補貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號
2019-07-25
<!DOCTYPE html >
<html xmlns="http://www.w3.org/1999/xhtml">
? ? <head>
? ? ? ? <title>使用load()方法異步請求數(shù)據(jù)</title>
? ? ? ? <script src="http://idcbgp.cn/static/lib/jquery/1.9.1/jquery.js" type="text/javascript"></script>
? ? ? ? <link href="style.css" rel="stylesheet" type="text/css" />
? ? </head>
? ??
? ? <body>
? ? ? ? <div id="divtest">
? ? ? ? ? ? <div class="title">
? ? ? ? ? ? ? ? <span class="fl">我最愛吃的水果</span>?
? ? ? ? ? ? ? ? <span class="fr">
? ? ? ? ? ? ? ? ? ? <input id="btnShow" type="button" value="加載" />
? ? ? ? ? ? ? ? </span>
? ? ? ? ? ? </div>
? ? ? ? ? ? <ul><h3></h3></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.html",function(){
? ? ? ? ? ? ? ? ? ? ? ? $this.attr("disabled", "true");
? ? ? ? ? ? ? ? ? ? });
? ? ? ? ? ? ? ? })
? ? ? ? ? ? });
? ? ? ? </script>
? ? </body>
</html>
2019-07-02
把圖片路徑以及js路勁改好? http改成https