Skip to content

Instantly share code, notes, and snippets.

@marinalohova
Created April 20, 2016 18:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marinalohova/29b805661282994b645893ac22adaffb to your computer and use it in GitHub Desktop.
Save marinalohova/29b805661282994b645893ac22adaffb to your computer and use it in GitHub Desktop.
Why not use jQuery shorthands for ajax requests?
filterNetworks(value) {
$.ajax({
url: this.props.url,
data: {
network: network,
page: pageNumber||1,
search: search
},
dataType: 'json',
success: function (carts) {
this.setState({data:carts});
}.bind(this),
error: function (xhr, status, err) {
}.bind(this)
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment