I have a very simple hello world ajax-php example that returns as a result the whole php script. here's the code:
client code:
$.ajax({
type: "GET",
contentType: "text",
url: "hello-world.php",
success: function(data){
$("#myDiv").text(data);
console.log(data);
}
});
server code:
<?php
// A simple web site in Cloud9 that runs through Apache
// Press the 'Run' button on the top to start the web server,
// then click the URL that is emitted to the Output tab of the console
echo 'Hello world!';
?>
here's the console log:
<?php
// A simple web site in Cloud9 that runs through Apache
// Press the 'Run' button on the top to start the web server,
// then click the URL that is emitted to the Output tab of the console
echo 'Hello world!';
?>
thanks!