I was tasked in moving an old app on a CF8 server to a CF7 server. The app
has some cfajax code that I'm not familiar with. I'm hoping someone here
has seen the error..
This is most of an email I sent internally to the person who created in a
few years back but thought I'd also ask a larger crowd

The error message is a javascript popup and all it shows is:

*The page at localhost:8300 says: *
SyntaxError: Unexpected token <


This happens whenever you hit "Save" on the time_off page (when requesting
Time Off).
I've added some alerts in the code:

DWRUtil.useLoadingMessage("Checking for duplicate request...");

//alert(oForm.employee_id.value);
//alert(oForm.time_off_start_date.value);
//alert(oForm.time_off_end_date.value);

DWREngine._execute(_ajaxConfig._cfscriptLocation, null,
'getEmployeeTimeOff', oForm.employee_id.value,
oForm.time_off_start_date.value, oForm.time_off_end_date.value, true,
handleTimeOffDuplicateCheck);

//alert("getEmployeeTimeOff");

And all of the alerts go off, including the "getEmployeeTimeOff" alert.
I put an alert at the top of the handleTimeOffDuplicateCheck and it doesn't
run.
So it's not even making it to that function.

I thought maybe it's in that CF function getEmployeeTimeOff
so I changed it to static values..

SELECT tt.date_taken,
Format(tt.date_taken,'mm/dd/yyyy') as text_date_taken,
month(tt.date_taken) as date_taken_month,
tt.time_off_id,
toff.descr as time_off_descr
FROM time_taken tt
INNER JOIN time_off toff ON toff.time_off_id = tt.time_off_id
WHERE tt.employee_id = 'e0012345'
AND tt.deletedon is null
AND tt.date_taken >= 11/11/2011
AND tt.date_taken <= 11/11/2011
ORDER BY tt.date_taken

which runs in Access and returns 0 rows..
But when I try to add Time Off, same "Syntax <" error.

Then I put quotes around the dates knowing this is wrong and should give a
DB error.. and it does! Javascript error about types.
So it makes it to the CF function, that I assume THAT even works, and then
something happens coming back but where?
The alert in the Javascript function that should run on return, doesn't
run.. but if you throw in an error in the query, it errors..

In Chrome, I do see a couple JavaScript errors:
When choosing the person in the drop down it errors:
Uncaught TypeError: Cannot set property 'checked' of undefined

Which doesn't seem to affect anything.. it's still returns the employee.
The element it's referring to would only be there if you're an admin.

The error that bothers me is when you hit Save, it errors with:

Refused to set unsafe header "Referer"

but it makes it to CF fine, just not back.. I googled that yesterday and
nothing stood out.



I'm at my wits end and I don't know where else to look in the code. Was
something anything that had to be installed on the system? Anything you
guys can recommend, suggest, remember.. would be helpful.


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:348639
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to