PDA

View Full Version : [RESOLVED] Parse Error in ext-js-debug.js



JasonMichael
9 Jun 2007, 10:07 AM
Line 6116 of ext-all-debug.js (on my version) reads:


this.decode = function(json){
return eval("("+ json + ')');
};

it works better when I change it to :



this.decode = function(json){
return eval("('+ json + ')");
};


This seems to be affecting the submission of forms - tons of posts on this. I see this in the two latest versions - 1.0.1a and 1.1 Beta 1...

I'm not an expert though, so maybe this fix isn't correct.

-Jason

perrich
9 Jun 2007, 10:24 AM
I think that previous version is correct. Your "patch" can't work...

If you have a issue with this line, it's json value error not in ext-all-debug.js

JasonMichael
9 Jun 2007, 11:54 AM
Okay, thanks - I suspected that as well...

I'll leave this post here for further reference so others don't try to make the same mistake I did. I see that this code exists quite happily in the last stable version. so it must be something to do with JSON, when auto generated forms are used and submitted...

Jason

JasonMichael
9 Jun 2007, 11:58 AM
In regards to this problem, I figured it out - this is not a but in EXTJS. This happens when there is an error in your PHP script that handles the file upload. I tested this by doing an alert(json) in the decode function that Firefox complains about... and it spit out the server response which was an error messsage about a type I had on line 6 of my own PHP code. So while extjs is looking for a nice clean response, it didn't like the PHP error message (since I have display errors turned on).