Problem receiving data from AJAX

Hello,

I have this code that I run when a button is clicked:

callAjax: function(){
	var ajax = new enyo.Ajax({
		url: "http://localhost/hello.php",
	});
	ajax.go({});
	ajax.response(this, "processResponse");
	ajax.error(this, "processError");
},
processResponse: function(inSender, inResponse){
	// show response in a popup
	this.$.popupResponse.setContent(inResponse); 
	this.$.popupResponse.show();
},
processError: function(inSender, inResponse){
	this.$.popupError.setContent(inResponse);
	this.$.popupError.show();
},
This is the hello.php code:

<?php echo "hello"; ?>
All is working fine in my local XAMPP. processResponse is executed and "hello" is showed in a popup.

But if I upload hello.php to a remote server (and change url parameter), processError is executed and it always shows "0" in the popup.

I have seen in the Firebug log that GET returns "200 OK", but I don't know why is executed processError and why shows "0".

Can anybody help me?

Thank you

Comments

Sign In or Register to comment.