Code Monkey home page Code Monkey logo

jquery-ajaxtransport-xdomainrequest's Introduction

Cross-Domain AJAX for IE8

Implements automatic Cross Origin Resource Sharing support using the XDomainRequest object for IE8 and IE9 when using the ajax function in jQuery 1.5+.

CORS requires the Access-Control-Allow-Origin header to be present in the AJAX response from the server.

In order to use XDomainRequest in Internet Explorer, the request must be:

  • Only GET or POST
  • When POSTing, the data will always be sent with a Content-Type of text/plain
  • Only HTTP or HTTPS
  • Protocol must be the same scheme as the calling page
  • Always asynchronous

Working example here: http://jsfiddle.net/MoonScript/Q7bVG/show/

Instructions

With at least jQuery version 1.5, just include this jQuery.XDomainRequest.js script into your page, then make your AJAX call like you normally would:

$.ajax({
  url: 'http://jsonmoon.jsapp.us/',
  dataType: 'json'
}).done(function(data){
  console.log(data.name.first);
});

CDNJS

This script is hosted by CDNJS: http://cdnjs.cloudflare.com/ajax/libs/jquery-ajaxtransport-xdomainrequest/1.0.0/jquery.xdomainrequest.min.js

jquery-ajaxtransport-xdomainrequest's People

Contributors

jcruz2us avatar moonscript avatar fidian avatar

Watchers

Michael Benin avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.