我的下面的代码工作正常。这个jQuery代码有什么问题?
$(document).ready(function() {
$('a.address').click(function() {
$('#box').slideDown("slow");
$.ajax({
type: "POST",
url: "details.php",
success: function(html){
$("#msg").html(html);
}
});
});
});
但以下情况不(仅1线成功:)内改变,它加载什么..只有slidesdown的#box和#msg内,但不加载#address。
$(document).ready(function() {
$('a.address').click(function() {
$('#box').slideDown("slow");
$.ajax({
type: "POST",
url: "details.php",
success: function(html){
$("#msg").html($(html).find('#address').html());
}
});
});
});
The details.php is:
<div id="info">some text.</div>
<div id="address">The address</div>
+1 jQuery很迷人 – TheVillageIdiot 2011-01-28 17:20:57