課程
/前端開發
/jQuery
/jQuery基礎(五)一Ajax應用與常用插件
代碼復制到本地無法運行怎么解決?怎樣在本地使用load。
2019-07-01
源自:jQuery基礎(五)一Ajax應用與常用插件 1-1
正在回答
<!DOCTYPE html >
<html xmlns="http://www.w3.org/1999/xhtml">
? ? <head>
? ? ? ? <title>使用load()方法異步請求數據</title>
? ? ? ? <script src="http://www.xianlaiwan.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://www.xianlaiwan.cn/data/fruit.html",function(){
? ? ? ? ? ? ? ? ? ? ? ? $this.attr("disabled", "true");
? ? ? ? ? ? ? ? ? ? });
? ? ? ? ? ? ? ? })
? ? ? ? ? ? });
? ? ? ? </script>
? ? </body>
</html>
把圖片路徑以及js路勁改好? http改成https
weixin_慕瓜0263649 提問者
舉報
如何用jquery實現ajax應用,加入學習,有效提高前端開發速度
1 回答為什么復制到本地,load方法不能用了?跨域了?
3 回答為什么我本地運行不出效果
3 回答報這個錯誤怎么解決?
2 回答ajax load本地頁面,顯示error,找不到這個頁面,是怎么回事?
1 回答post 和 get用的時候php文件是不是都要傳到服務器上才行?我再本地的文件運行不了
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網安備11010802030151號
購課補貼聯系客服咨詢優惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號
2019-07-25
<!DOCTYPE html >
<html xmlns="http://www.w3.org/1999/xhtml">
? ? <head>
? ? ? ? <title>使用load()方法異步請求數據</title>
? ? ? ? <script src="http://www.xianlaiwan.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://www.xianlaiwan.cn/data/fruit.html",function(){
? ? ? ? ? ? ? ? ? ? ? ? $this.attr("disabled", "true");
? ? ? ? ? ? ? ? ? ? });
? ? ? ? ? ? ? ? })
? ? ? ? ? ? });
? ? ? ? </script>
? ? </body>
</html>
2019-07-02
把圖片路徑以及js路勁改好? http改成https