已采納回答 / 素小暖
$.getScript("abc.js",function(){abc()});在a.js中定義一個函數abc(),然后就可以在function(){}中調用了,包括獲取函數的返回值。此外,也可以在abc.js中定義一個全局變量,這個變量在function(){}中也是可見的。
2018-01-17
var stuList = [
{ "name": "yifon" },
{ "name": "june" },
{ "name": "apple" }];
$.each(stuList, function (index, item) {
// $("#stuList").append("<li>姓名:" + stuList[index].name + "</li>");
$("#stuList").append("<li>姓名:" + item.name + "</li>");
})
{ "name": "yifon" },
{ "name": "june" },
{ "name": "apple" }];
$.each(stuList, function (index, item) {
// $("#stuList").append("<li>姓名:" + stuList[index].name + "</li>");
$("#stuList").append("<li>姓名:" + item.name + "</li>");
})
$(document).ajaxStart(function () {
$("#divload").show();
})
$(document).ajaxStop(function () {
$("#divload").hide();
})
$("#divload").show();
})
$(document).ajaxStop(function () {
$("#divload").hide();
})
2018-01-14
解決跨域的問題可以搭個本地服務器,再使用代理,實現客戶端->請求本地服務器->請求慕課網資源,解決跨域問題。
代碼只需要看ajax-learing下check_f相關的即可。不過遇到了同時使用bodyParser.json()和bodyParser.urlencode()沖突的問題,等待各大論壇大神解答。
https://github.com/yifon/WebLearning
代碼只需要看ajax-learing下check_f相關的即可。不過遇到了同時使用bodyParser.json()和bodyParser.urlencode()沖突的問題,等待各大論壇大神解答。
https://github.com/yifon/WebLearning
2018-01-14
在線編程不會有跨域的問題,但是復制到本地直接用客戶端去訪問就會有跨域的問題。解決跨域的問題可以搭個本地服務器,再使用代理,實現客戶端->請求本地服務器->請求慕課網資源,解決跨域問題。
代碼只需要看ajax-learing下info_f相關的即可。
https://github.com/yifon/WebLearning
代碼只需要看ajax-learing下info_f相關的即可。
https://github.com/yifon/WebLearning
2018-01-13
在線編程不會有跨域的問題,但是復制到本地直接用客戶端去訪問就會有跨域的問題。解決跨域的問題可以搭個本地服務器,再使用代理,實現客戶端->請求本地服務器->請求慕課網資源,解決跨域問題。
代碼只需要看ajax-learing下sport_f相關的即可。
https://github.com/yifon/WebLearning
代碼只需要看ajax-learing下sport_f相關的即可。
https://github.com/yifon/WebLearning
2018-01-13
在線編程不會有跨域的問題,但是復制到本地直接用客戶端去訪問就會有跨域的問題。解決跨域的問題可以搭個本地服務器,再使用代理,實現客戶端->請求本地服務器->請求慕課網資源,解決跨域問題。
本地用node.js搭了服務器,再使用代理中間件做請求的轉發http-proxy-middleware。 代碼只需要看ajax-learing下sport相關的即可。
https://github.com/yifon/WebLearning
本地用node.js搭了服務器,再使用代理中間件做請求的轉發http-proxy-middleware。 代碼只需要看ajax-learing下sport相關的即可。
https://github.com/yifon/WebLearning
2018-01-13
在線編程不會有跨域的問題,但是復制到本地直接用客戶端去訪問就會有跨域的問題。解決跨域的問題可以搭個本地服務器,再使用代理,實現客戶端->請求本地服務器->請求慕課網資源,解決跨域問題。
本地用node.js搭了服務器,再使用代理中間件做請求的轉發http-proxy-middleware。 代碼只需要看ajax-learing下fruit相關的即可。
https://github.com/yifon/WebLearning
本地用node.js搭了服務器,再使用代理中間件做請求的轉發http-proxy-middleware。 代碼只需要看ajax-learing下fruit相關的即可。
https://github.com/yifon/WebLearning
2018-01-13
最新回答 / 慕尼黑7231240
在josn里,這個樣子的
[{?
??"name":?"足球"
},{?
??"name":?"散步"
},{?
??"name":?"籃球"
},{?
??"name":?"乒乓球"
},{?
??"name":?"騎自行車"
}]不過這個sport參數我也沒想明白,可以寫成別的,但是這個參數的位置不知道有什么說道
2018-01-10
.load("http://www.xianlaiwan.cn/data/fruit_part.html", function () {
<script src="http://www.xianlaiwan.cn/static/lib/jquery/1.9.1/jquery.js"></script>
<script src="http://www.xianlaiwan.cn/static/lib/jquery/1.9.1/jquery.js"></script>
2018-01-09