0
我使用AJAX从我的php页面动态获取数据并将其显示在html页面上。它不工作。这里是link to the pageAJAX动态获取文件中的数据不起作用
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");
});
感谢您指出,但仍然不工作 – dragonfly 2011-04-10 08:56:06
@dragonfly发现你的下一个问题,你是在jQuery之前引用你自己的JavaScript。下次首次使用firebug/webkit开发工具进行测试。 – 2011-04-10 08:58:00
它也应该在$(function(){codehere})块中; – 2011-04-10 09:05:13