MCPcopy Create free account
hub / github.com/angular-ui/ui-grid / getBaseUrl

Function getBaseUrl

lib/test/angular/1.7.0/angular.js:21105–21120  ·  view source on GitHub ↗

* Returns the current document base URL. * @returns {string}

()

Source from the content-addressed store, hash-verified

21103 * @returns {string}
21104 */
21105function getBaseUrl() {
21106 if (window.document.baseURI) {
21107 return window.document.baseURI;
21108 }
21109
21110 // `document.baseURI` is available everywhere except IE
21111 if (!baseUrlParsingNode) {
21112 baseUrlParsingNode = window.document.createElement('a');
21113 baseUrlParsingNode.href = '.';
21114
21115 // Work-around for IE bug described in Implementation Notes. The fix in `urlResolve()` is not
21116 // suitable here because we need to track changes to the base URL.
21117 baseUrlParsingNode = baseUrlParsingNode.cloneNode(false);
21118 }
21119 return baseUrlParsingNode.href;
21120}
21121
21122/**
21123 * @ngdoc service

Callers 1

urlIsSameOriginAsBaseUrlFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected