I want to call a php function from Ajax and have the contents returned to the webpage.
Say I have a file called latest.php that returns some very simple html.
$result = "<div> text </div>";
echo $result;
how can I write an Ajax script that calls this php file, returns the html and stores it in a javascript variable?