MCPcopy Index your code
hub / github.com/angular-ui/ui-grid / urlResolve

Function urlResolve

lib/test/angular/1.4.3/angular.js:17816–17841  ·  view source on GitHub ↗

* * Implementation Notes for non-IE browsers * ---------------------------------------- * Assigning a URL to the href property of an anchor DOM node, even one attached to the DOM, * results both in the normalizing and parsing of the URL. Normalizing means that a relative * URL will be resolved

(url)

Source from the content-addressed store, hash-verified

17814 *
17815 */
17816function urlResolve(url) {
17817 var href = url;
17818
17819 if (msie) {
17820 // Normalize before parse. Refer Implementation Notes on why this is
17821 // done in two steps on IE.
17822 urlParsingNode.setAttribute("href", href);
17823 href = urlParsingNode.href;
17824 }
17825
17826 urlParsingNode.setAttribute('href', href);
17827
17828 // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
17829 return {
17830 href: urlParsingNode.href,
17831 protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
17832 host: urlParsingNode.host,
17833 search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
17834 hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
17835 hostname: urlParsingNode.hostname,
17836 port: urlParsingNode.port,
17837 pathname: (urlParsingNode.pathname.charAt(0) === '/')
17838 ? urlParsingNode.pathname
17839 : '/' + urlParsingNode.pathname
17840 };
17841}
17842
17843/**
17844 * Parse a request URL and determine whether this is a same-origin request as the application document.

Callers 8

createHttpBackendFunction · 0.70
parseAbsoluteUrlFunction · 0.70
parseAppUrlFunction · 0.70
$LocationProviderFunction · 0.70
$$SanitizeUriProviderFunction · 0.70
angular.jsFile · 0.70
urlIsSameOriginFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected