PDA

View Full Version : [Solved] missing ) in parenthetical



cluettr
28 Jul 2007, 1:12 PM
While this may not be an Ext or javascript error I wanted to post it here because there were 5 other similar posts. None addresses my issue specifically and I'm having a but of trouble getting to root cause. My upload fails and gives me the error "missing ) in parenthetical" and by looking into Firebug you can see that for some reason a "(" is being wrapped around the json response wit no ")".

(test.xlstest.xls{"success":true,"message":"File uploaded, renamed.","id":100} \n


From what I've read neither should exist. My php code which returns the json value is clear of everything but the echo of the json_encode...


echo json_encode($resp);

What is odd about the response is that it is throwing in the "(" and the filename twice as part of the response but at no place in my code is this echoed. Has anyone run into a similar issue?

missing ) in parenthetical
hide("loading_site")prototype.js (line 1315)
onComplete(Object container=Object transport=XMLHttpRequest)default.php (line 644)
dispatch(Object)prototype.js (line 943)
(no name)(Object)prototype.js (line 429)
_each(function())prototype.js (line 654)
_each(function())prototype.js (line 927)
each(function())prototype.js (line 428)
dispatch("onComplete", Object container=Object transport=XMLHttpRequest, XMLHttpRequest, null)prototype.js (line 940)
respondToReadyState(4)prototype.js (line 1105)
onStateChange()prototype.js (line 1041)
bind()prototype.js (line 102)

(test.xlstest.xls{"success":true,"message":"File uploaded, renamed.","id":100} \n

cluettr
28 Jul 2007, 1:15 PM
Fugetaboutit... : )

I was echoing two statements... caused the problem... my bad... maybe this thread will help someone else...who knows...

bullfrog
30 Oct 2007, 7:36 AM
I was seeing the same error message with the seemingly mysterious parenthesis mark added to my json string. I spent a fair amount of time trying to determine where there was an extra '(' or a missing ')' before coming across the real problem. In my case, the bug was that I had a leading 's:' before my json:



s:[{"fieldName":"flash...


The 's:' makes the json invalid, which is what the error message 'missing ) in parenthetical' really means. Once I removed this prefix, thus making my json valid again, the problem was solved.

Thus, if you get this message, look into why your json might be invalid, or even use a json validator to test it directly.

RoMeLuKo
15 Aug 2008, 3:30 PM
I got a "missing ) in parenthetical" too, when I was using a php file, thanks to Firebug I detected that my hosting was adding a code like Google Analytics code above my JSON answer ... Good luck .. (sorry for the my bad english)