02-11-2010, 09:25 AM
[eluser]chefnelone[/eluser]
Hello.
I can't get the responce for ajax post call.(using jquery).
But this problem just happens in the remote server. In my locallhost works fine. :ohh:
I have the form:
the js:
and the method in shop controller:
I cant's spot the mistake. ..
Hello.
I can't get the responce for ajax post call.(using jquery).
But this problem just happens in the remote server. In my locallhost works fine. :ohh:
I have the form:
Code:
<form id='test'>
<input type="text" name="xxx" value="test" />
<input type="submit" value="enviar"/>
</form>
the js:
Code:
$(document).ready(function() {
$('#test').submit(function(eve) {
eve.preventDefault();
$.post('/shop/test' , $(this).serialize() , function(html){
alert(html);
//I can't get 'html' which should contain "Data from the method" text
});
});
and the method in shop controller:
Code:
function test()
{
$data = "Data from the method";
echo $data;
$this->firephp->log( $data);
// I get this, so the method is called from the javascript
}
I cant's spot the mistake. ..