Copy link to clipboard
Copied
Hello, everyone.
Another issue that I can't quite wrap my head around.
The web app I'm working on will insert/select data from one of two tables, depending.
If I'm adding data to table2, there are no issues.
If I'm adding data to table1 and it's not the first data being insert after the browser is opened, there are no issues.
If I'm adding data to table1 and it IS the first data being insert after the browser is opened, there is an issue. [throw new SyntaxError("parseJSON"); (Line 805)]
HOWEVER, if I ignore the issue and click the submit button, again, the data is inserted with no issues. WeIrD.
I'm using CFAJAXPROXY to access a few methods via JavaScript; one of them being a method called "addRow" - it will either add or update a row of data in a table, depending upon whether or not the data already exists. I am using this for adding data to both table1 and table2, so I am confused as to why this is only happening with table1.
The form isn't actually being submit; I'm calling the AJaX proxy (via a form validator) if validation passes, and using a JavaScript alert if validation fails.
Unfortunately, I cannot alter the method to include 'returnformat="JSON"' - this is being used by more than one web app.
Any ideas?
^_^
Copy link to clipboard
Copied
From FireBug:
uncaught exception: [Exception... "'SyntaxError: parseJSON' when calling method: [nsIDOMEventListener::handleEvent]" nsresult: "0x8057001c (NS_ERROR_XPC_JS_THREW_JS_OBJECT)" location: "JS frame :: chrome://firebug/content/spy.js :: callPageHandler :: line 744" data: no]
^_^
Copy link to clipboard
Copied
The issue exists because the CFC is located outside of the root for the site. The initial access would cause the server to respond with a challenge for an RDS/Admin password.
The solution is to create a CFC with the same name in the local components directory, give it blank data (cffunction named whatever, cfargument named nothing set to "") and use the extends parameter pointing to the out-of-root CFC, and then remove the include for the out-of-root CFC.
^_^
(The CFC was located out of root because more than one site exists on the server and we wanted to be able to have one set of CFC's that all sites could access.)