How to store returned string from php file to Javascript variable through Ajax

SpeellLoT

New Member
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. \[code\]$result = "<div> text </div>";echo $result;\[/code\]how can I write an Ajax script that calls this php file, returns the html and stores it in a javascript variable?
 
Back
Top