Forum: Rails Spinoffs (closed, excessive spam) Extra empty _ param in ajax.request

6610bb520369abb55042774680545ef8?d=identicon&s=25 Billy Gray (Guest)
on 2008-07-11 22:04
(Received via mailing list)

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

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.

Ca3e484c121268e4c8302616b2395eb9?d=identicon&s=25 T.J. Crowder (Guest)
on 2008-07-11 22:14
(Received via mailing list)

We've started transitioning to a new, better-named, hopefully-spam-
free group for Prototype and

Could you please post your question there instead?  Thanks!  People
might still answer here, but probably not for all that much longer...
T.J. Crowder
tj / crowder software / com
This topic is locked and can not be replied to.