1.0.6 • Published 12 years ago

uxhr v1.0.6

Weekly downloads
2
License
-
Repository
github
Last release
12 years ago

#µXHR

The teeny tiny cross-browser XHR library - just 426 bytes gzipped!

##Usage

// with a data object
uxhr('endpoint.html', {
	foo: 'bar',
	baz: 5
}, {
	complete: function (response) { ... }
});

// ... or with a data string
uxhr('endpoint.html', 'war=peace&freedom=slavery&ignorance=strength', {
	complete: function (response) { ... }
});

##Arguments

ArgumentTypeRequired
urlStringYes
dataStringObjectNo
optionsObjectNo

##Options

OptionTypeDefaultNotes
methodStringGETGET, POST, PUT, DELETE, etc.
headersObject{}Custom headers for this request
timeoutNumber0Timeout (in ms) before aborting the request
completeFunctionfunction(){}Callback fired when the request is completed
successFunctionfunction(){}Callback fired when the request is completed successfully (eg. with HTTP status code < 400)
errorFunctionfunction(){}Callback fired when the request returns an error (eg. HTTP status code >= 400)

Tested on

  • Chrome 29 on OSX
  • Chrome 28 on Windows
  • Firefox 23 on OSX
  • Firefox 21 on Windows
  • Internet Explorer 7-10 on Windows
  • Opera 16 on OSX
  • Safari 6 on OSX
  • Safari 6 on iPhone4/iOS6
  • Safari 6 on iPhone5/iOS6
  • Safari 6 on iPad2/iOS6
  • Safari 6 on iPad3/iOS6
1.0.6

12 years ago

1.0.5

12 years ago

1.0.4

12 years ago

1.0.3

12 years ago

1.0.2

12 years ago

1.0.1

12 years ago

1.0.0

12 years ago