PDA

View Full Version : Javascript error


bigmike3d
03-21-2009, 08:47 PM
I'm getting this error when trying to Add To Cart while using the Live View in DreamWeaver CS4.
"Microsoft VBScript compilation error '800a03f2'

Expected identifier

/FreshElSabor/WA_eCart/WA_eCart_Definition_VB.asp, line 81"

I have no idea what this means and can't find any answers. Can someone help me?

Ray Borduin
03-23-2009, 07:34 AM
What code appears on that line of code referenced in the error? That is where you would start when debugging this problem.

bigmike3d
03-23-2009, 08:03 AM
Thank you for you response.
T
his is the function that the error refers to: Which is part of the WA_eCart_Definition_VB.asp.

"function WA_eCart_DisplayInfo(cartObj, ItemProperty)
retVal = ""
if (NOT WA_eCart_IsEmpty(cartObj) AND NOT WA_eCart_EOF(cartObj)) then
retVal = (eval("cartObj.Items(cartObj.DisplayIndex)." & ItemProperty))
end if
WA_eCart_DisplayInfo = retVal
end function"

Line 81 is "retVal = (eval("cartObj.Items(cartObj.DisplayIndex)." & ItemProperty))"

I've looked and I can't see a problem with this code. This happens when I click the Add To Cart Button. What is good is that the item is added to the shopping cart, but this error is stopping the shopping cart from coming up.

Ray Borduin
03-23-2009, 02:37 PM
OK, this is in the DisplayInfo() method definition. Which means you have a bad DisplayInfo() reference on the page. Do you get the same error when browsing your page on your web server. You may have to go through the page to find the typo causing the problem in that method reference.

bigmike3d
03-24-2009, 03:54 AM
Ok!! I finally found the error, based on your response I looked at the script related to the Display Info() routine and found that the Add Item Details To Database had an empty string where it shouldn't have. So I went back and found that the price field didn't have a value linked to it. I thank you for your response which gave me the clue I needed to figure it out.