Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if ('withCredentials' in new XMLHttpRequest()) {
- /* supports cross-domain requests */
- }
- //Detect browser support for CORS
- if ('withCredentials' in new XMLHttpRequest()) {
- /* supports cross-domain requests */
- document.write("CORS supported (XHR)");
- }
- else if(typeof XDomainRequest !== "undefined"){
- //Use IE-specific "CORS" code with XDR
- document.write("CORS supported (XDR)");
- }else{
- //Time to retreat with a fallback or polyfill
- document.write("No CORS Support!");
- }
Add Comment
Please, Sign In to add comment