View Full Version : Ext.Ajax.request Problem

12 Jul 2010, 4:03 AM

I hard to find solve this problem. But I could not.

Please help me.

My code is

var makeAjaxRequest = function() {
url : 'test.json',
success: function ( result, request ) {
alert("Success: "+result.responseText);
failure: function ( result, request) {
alert("Failed: "+result.responseText);

Continually alert message("Failed:") show me.


12 Jul 2010, 5:31 AM
Failure indicates that the http request failed. Interrogate the response object to find out the error code.

console.log(response.status, response.statusText);

12 Jul 2010, 3:34 PM
Um.... I tried to indicate failure log massage.

Like this :

console.log(result.status, result.statusText);

But console log showed me

0 ""

:-( Do you know what is wrong?

I used crome.

12 Jul 2010, 4:18 PM
Oh!!!! I solve this problem.

I usually execute code by dragging html file into crome.

At this time, code is not operate.

But, execute code by clicking run-button in aptana application,

the code could operate.

What is different between both situation? -_-;

(I`m sorry about pool my English skill...)

12 Jul 2010, 5:11 PM
Ajax will only work if you run it through a web server.

If you drag the file into chrome, it probably runs it as "file://" instead of "http://localhost/..."

12 Jul 2010, 5:38 PM
Thank you very much^_^