PDA

View Full Version : Ext.Ajax.request : IE8 OK and FF/CHROME ERROR



locas
28 Mar 2011, 11:50 AM
Good evening,

I'm starting with ExtJS and I tried to create the following example:

http://www.extensions.extjs.com/learn/Manual:Core:Ext.Ajax

Here is my code:

----------------------------------------------------------------------------
test.js :
----------------------------------------------------------------------------

Ext.Ajax.request({
url : 'http://localhost/test/ws.php',
params : { action : 'getDate' },
method: 'GET',
success: function ( result, request ) {
Ext.MessageBox.alert('Success', 'Data return from the server: '+ result.responseText);
},
failure: function ( result, request) {
Ext.MessageBox.alert('Failed', result.responseText);
}
});

----------------------------------------------------------------------------
ws.php :
----------------------------------------------------------------------------

<?php

if ($_REQUEST['action'] == 'getDate')
{
echo "{date: '" . date('l dS \of F Y h:i:s A') . "'}";
}

?>

The code works perfectly in IE8 but not work in Chrome and Firefox.

I tried several different example but the result remains the same ... anyone have an idea of the problem?

Thank you in advance for your return.