My following code works fine.
$(document).ready(function() {
$('a.address').click(function() {
$('#box').slideDown("slow");
$.ajax({
type: "POST",
url: "details.php",
success: function(html){
$("#msg").html(html);
}
});
});
});
However the following does not (only 1 line is changed inside the success:), it loads nothing.. only slidesdown the #box, and #msg inside, however does not load #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>