我想內容導入使用DIV:內容導入DIV
$(document).ready(function() {
$('#myDiv').load('https://static.webshopapp.com/shops/054833/files/057957154/needtoknow.html');
});
它不工作。任何人都可以幫忙嗎? JSFIDDLE here。最終的結果應該有文本「測試箱1」
我想內容導入使用DIV:內容導入DIV
$(document).ready(function() {
$('#myDiv').load('https://static.webshopapp.com/shops/054833/files/057957154/needtoknow.html');
});
它不工作。任何人都可以幫忙嗎? JSFIDDLE here。最終的結果應該有文本「測試箱1」
如果您檢查控制檯,您會發現這個錯誤
Uncaught ReferenceError: $ is not defined
您需要導入jQuery庫項目 上JSFIDDLE
或工作:
$(document).ready(function() {
$('#myDiv').load('https://static.webshopapp.com/shops/054833/files/057957154/needtoknow.html');
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="myDiv">hello</div>
田田!現在它工作了! https://jsfiddle.net/wht4ejvz/1/ –
@RajaprabhuAravindasamy的意思是說...你需要jQuery庫加載來做到這一點 –
aargh假人我。謝謝你們。 – Eddy