MCPcopy
hub / github.com/angular-ui/ui-router / createXhr

Function createXhr

test/angular/1.2/angular.js:8534–8546  ·  view source on GitHub ↗
(method)

Source from the content-addressed store, hash-verified

8532}
8533
8534function createXhr(method) {
8535 //if IE and the method is not RFC2616 compliant, or if XMLHttpRequest
8536 //is not available, try getting an ActiveXObject. Otherwise, use XMLHttpRequest
8537 //if it is available
8538 if (msie <= 8 && (!method.match(/^(get|post|head|put|delete|options)$/i) ||
8539 !window.XMLHttpRequest)) {
8540 return new window.ActiveXObject("Microsoft.XMLHTTP");
8541 } else if (window.XMLHttpRequest) {
8542 return new window.XMLHttpRequest();
8543 }
8544
8545 throw minErr('$httpBackend')('noxhr', "This browser does not support XMLHttpRequest.");
8546}
8547
8548/**
8549 * @ngdoc service

Callers 5

createHttpBackendFunction · 0.70
createHttpBackendFunction · 0.50
createHttpBackendFunction · 0.50
createHttpBackendFunction · 0.50
createHttpBackendFunction · 0.50

Calls 2

matchMethod · 0.80
minErrFunction · 0.70

Tested by

no test coverage detected