(I am pretty new to all this.) I have a page where the user can click between different sorting methods of user posts. Depending on which they click the content shown will correspond.
function newContent()
{
$.ajax({
url: 'ajax/newcontent.php',
success: function()
{
$("#content_div").empty().load("ajax/newcontent.php");
}
});
}
This is what I have now. But instead of loading the code from the .php page into the #content_box, the #content_box just goes blank.
Any help would be awesome!
EDIT ** changed #content_dov to #content_div - whoops
.load()is shorthand for an entirely new ajax request. It automatically overwrites the contents of it's target, so you don't need to call empty.