🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

@isoldajs/browser-ajax

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@isoldajs/browser-ajax

A browser-request wrapper suitable as Backbone.ajax drop-in replacement

1.0.1
latest
Source
npm
Version published
Maintainers
1
Created
Source

IsoldaJS Browser AJAX

This is a simple (~3Kb minified and gzipped) ajax function implementation suitable as Backbone.ajax drop-in replacement. For example when you use Backbone without jQuery.

Normally you don't want to use this function by hand, but should you need the interface is

var ajax = require('@isoldajs/browser-ajax');

ajax(options);

Where options can have the following properties (subset of jQuery.ajax):

  • type — HTTP method, defaults to 'GET',
  • url — request URL,
  • data — request payload. If it's an object, will be JSON stringified,
  • contentType — if set will be passed as 'Content-Type' header,
  • headers — any custom headers, sent as is,
  • success — success callback, gets response body as a single argument,
  • error — error callback, gets error object as a single argument.

Keywords

request

FAQs

Package last updated on 16 Jun 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts