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");