[英]AJAX to dynamically fetch data from a file not working
我正在使用AJAX從我的php頁面動態獲取數據並將其顯示在html頁面上。 它不起作用。 這是該頁面的鏈接
HTML Page where the call is made and result should be displayed
<h3><a href="#" id="get">John</a></h3>
<div>
<p class="post">Result to be displayed</p>
</div>
AJAX代碼
$.ajaxSetup ({
cache: false
});
// load() functions
var loadUrl = "../load.php";
$("#get").click(function(){
$(".post")
.html(ajax_load)
.load(loadUrl, "language=php&version=5");
});
$(function(){
$.ajaxSetup ({
cache: false
});
var loadUrl = "../load.php";
$("#get").click(function(){
$(".post")
.html(ajax_load)
.load(loadUrl, "language=php&version=5");
});
});
幾乎是你想要的。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.