MCPcopy Create free account
hub / github.com/JacksonTian/fks / urlResolve

Function urlResolve

fks_chart/bower_components/angular/angular.js:14524–14549  ·  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, base)

Source from the content-addressed store, hash-verified

14522 *
14523 */
14524function urlResolve(url, base) {
14525 var href = url;
14526
14527 if (msie) {
14528 // Normalize before parse. Refer Implementation Notes on why this is
14529 // done in two steps on IE.
14530 urlParsingNode.setAttribute("href", href);
14531 href = urlParsingNode.href;
14532 }
14533
14534 urlParsingNode.setAttribute('href', href);
14535
14536 // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
14537 return {
14538 href: urlParsingNode.href,
14539 protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
14540 host: urlParsingNode.host,
14541 search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
14542 hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
14543 hostname: urlParsingNode.hostname,
14544 port: urlParsingNode.port,
14545 pathname: (urlParsingNode.pathname.charAt(0) === '/')
14546 ? urlParsingNode.pathname
14547 : '/' + urlParsingNode.pathname
14548 };
14549}
14550
14551/**
14552 * Parse a request URL and determine whether this is a same-origin request as the application document.

Callers 8

completeRequestFunction · 0.85
parseAbsoluteUrlFunction · 0.85
parseAppUrlFunction · 0.85
$LocationProviderFunction · 0.85
$$SanitizeUriProviderFunction · 0.85
angular.jsFile · 0.85
urlIsSameOriginFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected