How should I port this Prototype to JQuery?

Posted by blu on Stack Overflow See other posts from Stack Overflow or by blu
Published on 2010-03-29T16:02:44Z Indexed on 2010/03/29 16:03 UTC
Read the original article Hit count: 281

Filed under:
|
|

There is currently this Prototype code that does a PUT:

new Ajax.Request(someUrl, {
    method: 'put',
    parameters: { 'foo': bar },
    onSuccess: function(response) { } .bind(this)
});

I found this post but the solution uses an extra parameter supported by RoR, however I am targeting an ASP.NET backend.

I searched a bit and found that not all browsers support PUT operations so apparently this could fail in certain browsers? This is already in prod, so a direct port would be fine for now I suppose.

As an aside, what is the deal with the bind(this) in the onSuccess function?

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about prototype