jQuery my server from another server
Posted: Thu Feb 17, 2011 12:53 pm
I am trying to return the results of a php file after sending a jquery request to it.
The page: http://simstests.zxq.net/
My js file when button is clicked located on my server:
my file petaction.php
now when clicking the button it says Healing or Attacking, but it doesn't say "test" afterwards...
The page: http://simstests.zxq.net/
My js file when button is clicked located on my server:
Code: Select all
$(document).ready(function(){
$("#attack").mouseup(function () {
$("#outcome").html("Attacking...");
$.ajax({
url: "http://www.phpengines.info/vPet2/ajax/petaction.php",
global: false,
type: "POST",
dataType: "html",
success: function(msg){
$("#outcome").html(msg);
},
error: function(msg) {
$("#outcome").html(msg);
}
});
});
$("#heal").mouseup(function () {
$("#outcome").html("Healing...");
$.ajax({
url: "http://www.phpengines.info/vPet2/ajax/petaction.php",
global: false,
type: "POST",
dataType: "html",
success: function(msg){
$("#outcome").html(msg);
},
error: function(msg) {
$("#outcome").html(msg);
}
});
});
});
my file petaction.php
Code: Select all
die("test");