Skip to content
Extensios to jqXHR (deferred object) and ajax extension methods
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib
sit
test
testlib
.gitignore
README.md
jQueryAjaxRest.csproj
jQueryAjaxRest.sln
jquery.ajaxmethods.extension.js
jquery.xhr.extension.js

README.md

jQuery-Ajax-Rest

Extensios to jqXHR (deferred object) and ajax extension methods

##Features

  • jqxhr extensions
    • .failBy
    • .internalError
    • .badRequest
    • .preconditionFailed
    • .notFound
  • ajax shorthand functions
    • $.put
    • $.delete
    • $.getJSON
    • $.putJSON
    • $.postJSON
    • $.deleteJSON

##jQuery XHR extension:

jqXHR.failBy

API:
	jqxhr.failBy( statusCode , failCallback (jqxhr) )

Resgister um failcallback to status code response. Returns: jqXHR.

Remember that jqXHR is a deferred object

jqXHR.[errorCallback]

	jqxhr.internalError, jqxhr.badRequest, jqxhr.notFound, jqxhr.preconditionFailed

API:
	jqxhr.[method]( failCallback(jqxhr, status, error) )

Resgister um failcallback type of method called. Returns: jqXHR.

.

##jQuery Ajax extension methods:

$.[method]JSON

	$.getJSON, $.putJSON, $.postJSON, $.deleteJSON 
	
API:
	$.[method]JSON( url [, data ] [, success(data, textStatus, jqXHR) ] )

Make a json request type of method called. Returns: jqXHR.

This is a shorthand Ajax function, which is equivalent to:


		$.ajax({
		  url: url,
		  type: method,
		  data: data,
		  success: success,
		  dataType: "json",
		  contentType: "aplication/json;charset=UTF-8"
		});	

$.[method]

	$.get, $.put, post, $.delete`

API:
	$.[method]( url [, data ] [, success(data, textStatus, jqXHR) ] [, dataType ] )

Make a json request type of method called. Returns: jqXHR

This is a shorthand Ajax function, which is equivalent to:


		$.ajax({
		  url: url,
		  type: method,
		  data: data,
		  success: success,
		  dataType: type
		});	

You can’t perform that action at this time.