Extra empty _ param in ajax.request

25 views
Skip to first unread message

Billy Gray

unread,
Jul 11, 2008, 5:02:28 PM7/11/08
to Prototype & script.aculo.us
(I posted this to spinoffs earlier today, but TJ suggested I re-post
here, since this is the new place to hang ;-)

Folks,

While working on an instance of Ajax.Autocompleter that will bounce
off of a stored procedure via Oracle's mod_plsql (don't ask, it's been
a long strange journey), I ran into one final hiccup that I can't
quite fathom, although the workaround is pretty obvious.

When you hit a stored procedure in mod_plsql, if the parameters in the
query string don't match the procedure definition, you'll get a 404
error. And I was getting a 404 error, despite the fact that I got
exactly what I wanted if I directly accessed the URL.

I took a look in Firebug and it turns out that prototype's
Ajax.request method was attaching an extra parameter named '_' with no
value.

This little bit was doing it:

request: function(url) {
var parameters = this.options.parameters || '';
if (parameters.length > 0) parameters += '&_=';

I did try adding a useless extra param to my stored procedure def, but
you can't name an IN parameter with underscore and nothing else!

So, I just commented out that little bit there, and it works fine now.

So what is the &_= for? I'm sure it's pretty harmless in most
situations, but there doesn't seem to be a way to turn off the
behavior when it does cause trouble.

Cheers!
Billy

kangax

unread,
Jul 11, 2008, 5:43:28 PM7/11/08
to Prototype & script.aculo.us
Appending that underscore fixes an (empty XHR postBody) issue in
Safari 2.x
It may no longer be an issue.

-- kangax

Billy Gray

unread,
Jul 14, 2008, 10:13:22 AM7/14/08
to Prototype & script.aculo.us
Ah, that explains it. Well, at least it's out there for posterity
then.

Thanks for the info, kangax!

B
Reply all
Reply to author
Forward
0 new messages