PDA

View Full Version : Ext.Ajax.request Problem



nameroc
29 Apr 2009, 10:57 PM
Hi,

I've recently switched to Ext 3 RC 1, and I'm having some issues with Ext.Ajax.request. When I request a file which contains anything BUT JSON formatted data (regular html files, files which contain a <div>, files which contain simple javascript functions), it gives an 'missing (in parenthetical' error in firebug and the request does not complete. This used to work in the previous version of Ext JS.

I want to request non-json formatted files for my project using Ext.Ajax.request or some other method if that is possible.

Thanks in advance for any insights or ideas,
nameroc

Animal
29 Apr 2009, 11:54 PM
You are passing the result to eval() which is throwing this error.

Debug by seting a breakpoint in Ext's Ajax postprocessing, and stepping through until you see where the error is.

nameroc
30 Apr 2009, 12:43 AM
Thanks for the response, but I'm still confused. Here's the code that errors out:


Ext.Ajax.request({
scope : this,
url : '/js/ext_components/formlar/' + formName + '.js',
success : function(response){
}
});

This is the request that runs. As you can see, the success function is empty and nothing is being done with the response.

When the url points to a file which contains this:

{json:true}

It works correctly (as in, no errors in firebug).

However, when the url points to a file which contains:

json:false

It gives the

missing ) in parenthetical
chrome://firebug/content/blank.gif(json:false)

error in ext-all-debug.js, line 7570. The line does indeed contain eval(), but I don't get why it's trying to evaluate the result at all.

dawesi
30 Apr 2009, 1:04 AM
can you show the data you are getting back?

nameroc
30 Apr 2009, 1:12 AM
Sure. I think you mean this:
http://img513.imageshack.us/img513/9708/extjs.png

Animal
30 Apr 2009, 1:13 AM
Thanks for the response, but I'm still confused. Here's the code that errors out:


Ext.Ajax.request({
scope : this,
url : '/js/ext_components/formlar/' + formName + '.js',
success : function(response){
}
});

This is the request that runs. As you can see, the success function is empty and nothing is being done with the response.

When the url points to a file which contains this:

{json:true}

It works correctly (as in, no errors in firebug).

However, when the url points to a file which contains:

json:false

It gives the

missing ) in parenthetical
chrome://firebug/content/blank.gif(json:false)

error in ext-all-debug.js, line 7570. The line does indeed contain eval(), but I don't get why it's trying to evaluate the result at all.

So set a break there!

See what it's doing, and why, and see who called it, from where by going back through the call stack.

nameroc
30 Apr 2009, 1:28 AM
The error was in my code after all: A catch all requestcomplete that was written ages ago, and I'd forgotten about it.

Thanks for all the help,
nameroc