New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow passing data to GM_xmlhttpRequest callbacks #1725

Closed
PetrToman opened this Issue Mar 24, 2013 · 4 comments

Comments

Projects
None yet
3 participants
@PetrToman
Copy link

PetrToman commented Mar 24, 2013

Sometimes it is useful to pass data to ajax callback functions. I suggest adding 'context' option like jQuery.ajax() has - see http://api.jquery.com/jQuery.ajax/

$.ajax({
   url: "test.html",
   context: document.body
}).done(function() {
   $(this).addClass("done");
});
@Y0ba

This comment has been minimized.

Copy link

Y0ba commented Apr 14, 2013

Use bind() function.

   url: "test.html"
}).done(function() {
   $(this).addClass("done");
}.bind(document.body));
@PetrToman

This comment has been minimized.

Copy link

PetrToman commented Apr 16, 2013

Y0ba: That will do the job. Thanks! 👍

@PetrToman PetrToman closed this Apr 16, 2013

@arantius

This comment has been minimized.

Copy link
Collaborator

arantius commented Apr 16, 2013

This is a straightforward and backwards-compatible change, so I'd expect to include it.

@arantius arantius reopened this Apr 16, 2013

@arantius

This comment has been minimized.

Copy link
Collaborator

arantius commented Jun 7, 2013

@arantius arantius closed this in 7c9a9e7 Jun 7, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment