I am executing a file index.htmlfrom test1.com server. The Mootools library file is included in this index.htmlfile.
The following is a script that calls a PHP page:
<script>
var request = new Request.JSON({
url: 'http://test1.com/ajaxtest.php',
onSuccess: function(data) {
alert(JSON.stringify(data));
}
}).send();
</script>
ajaxtest.php
<?php
$arr['age'] = 30;
$arr['place'] = 'London';
echo json_encode($arr); exit;
?>
By performing index.html, I get the correct conclusion
{"age": 30, "place": "London"}
Now ajaxtest.phplocated on another server, say test2.com. How to change the above script to make it work as before?
source
share