AJAX to dynamically fetch data from a file not working
I'm Using AJAX to dynamically fetch data from my php page and display it on a html page. Its not working. Here is the link to the page
HTML Page where the call is made and result should be displayed
<h3><a href="#" id="get">John</a></h3>
开发者_如何学JAVA <div>
<p class="post">Result to be displayed</p>
</div>
AJAX code
$.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");
});
});
Is pretty much what you want.
精彩评论