Socket
Socket
Sign inDemoInstall

ajax.js

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    ajax.js

ajax.js =======


Version published
Maintainers
1
Install size
444 kB
Created

Readme

Source

ajax.js

Simple Network Requests for browser and NodeJS. This folder can be loaded as a Chrome Extension to include in web pages.

OR
var AJAX = require('ajax.js');

try {
  var AJAX = require('.');
} catch(e){
  var AJAX = require('ajax.js');
}

// Promise
AJAX.get('https://httpbin.org/get?a=1').then(console.log);

// Callback
AJAX.get('https://httpbin.org/get?a=1', null, (o)=>{
  console.log('lets try a callback..', o);
});

AJAX.post('https://httpbin.org/post', {data: {b: 2}}, (o)=>{
  console.log('lets try a POST..', o);
});

AJAX.post('https://httpbin.org/post', {data: {c: 3}, headers: {myMeta: 'data'}}, (o)=>{
  console.log('lets try a header..', o);
});

Keywords

FAQs

Last updated on 31 Dec 2016

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc