Hmm, I don't see anything awry on first inspection. Are you getting this error before the request fires or after the response returns? Are you using Firebug in Firefox to debug? It's essential for debugging Ajax requests.
This is happening before the servlet is called. I first get the initial alert saying its about to do the ajax but it never gets to the servlet. I know this because i have a sysout statement as the first line of code in the doGet method that doesnt get displayed.
Therefore my thought is as follows and please correct me if i'm mistaken. I'm using a few 3rd party scripts. Is it possible that another script has a Ajax wrapper defined?
my code is in custom.js
Joined: Jul 24, 2007
adding to my train of thought, is it possible to call a function of a script from another script? I wouldnt see why not, but who knows.
Originally posted by Ilya Elkind: I'm not using FF.
Start. Regardless of whether Firefox support is on your radar or not, Firebug in Firefox is by far the best way to find out what is going on with your Ajax requests. FF also has other great plugins like TamperData.
Originally posted by Ilya Elkind: adding to my train of thought, is it possible to call a function of a script from another script? I wouldnt see why not, but who knows.
Yes. They are all loaded into the same context. Caveat: you can call anything inline until it has been defined.
Joined: Jul 24, 2007
Ok i took your advice and it worked like a charm. I dl'd FF and installed Tamper Data plugin. Found out the call to my servlet was the wrong path. It was trying to call localhost:8080/AddVenueToFavorites.
Once i added my domain, then it worked.
I changed the line new Ajax.Request('/AddVenueToFavorites',... to new Ajax.Request('/MYDOMAIN/AddVenueToFavorites',...
Originally posted by Ilya Elkind: I was actually holding off FF testing till i was ready for that phase but this will help for debugging.
I find it's best to simultaneously develop for all browsers, relying on Firefox for the brunt of debugging of all but browser-specific issues.
Hope IE8 will have something equivilent.
My jQuery in Action co-author is very excited about the prospects of IE8, but I've been so disappointed with IE7 that I'm setting my expectations very low. [ May 02, 2008: Message edited by: Bear Bibeault ]
subject: Prototype Ajax.Request error - Function Expected Options