Question : How can I debug this JS error? (I get the stupid nondescript: "Microsoft JScript runtime error: Object expected" ...exception alert).

Well basically,

I am re-using some code that another developer who no longer works on this project created, and, I do believe I copied over all necessary (external, in an 'Includes" folder of his and now my solution) .js files, all classes, references, etc. to make it compile and run ok. My problem is, he has this js function that runs on mouse-over of GridView records, and whenever I run the app, I get the nondescript "Object Expected" error... with no other details. VS2008 takes me to the temporary (run-time) javascript that it istrying to execute, but it gives no indication of WHAT object is expected but not there....! I assume the object is the function result, but I've looked at the function and the way in which it is being wired up (in the GridView's OnItemDataBound- a bit of html triggers the onclick for each record), and I can't figure uot why it isn't working....

This is really giving me a hard time. If anyone has any suggestion, I am greatly appreciative. It just doesn't make sense- I must be missing something from his project which I reused this code from.

Thanks much,

oddic


PS: Really, I just need to figure out a way to step into the acutal JS function and see it execute. Can someone show me how to do this is VS2008 (I tried setting breakpoints in the external .js file, but they were not hit (VS says this is because the file "is not loaded".... apparently not at design or runtime).

Any and all help is seriosuly awesome!!!!!!! Thanks again.

Answer : How can I debug this JS error? (I get the stupid nondescript: "Microsoft JScript runtime error: Object expected" ...exception alert).

For future reference the "undescriptive" "Object Expected" is typically triggered when you mistyped a function name or the function does not exist at all on the current page usually the result of a failed include due to incorrect path. In your case, it seems the problem was being triggered by:
nameControl.show(textField, name);  

The "Object Expected" seems to have been "nameControl". Basically, from the browser's point of view, you were trying to invoke a method from a non existing object.
Random Solutions  
 
programming4us programming4us