私の次のコードは正常に動作します。このjQueryコードで何が問題になっていますか?
$(document).ready(function() {
$('a.address').click(function() {
$('#box').slideDown("slow");
$.ajax({
type: "POST",
url: "details.php",
success: function(html){
$("#msg").html(html);
}
});
});
});
次は(唯一の1行が成功:)内で変更されていませんしかし、それだけで#box slidesdown ...何をロードしないと、内部の#msgが、しかし#addressロードされません。あなたが$(html)
を書くとき
$(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