* * 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)
| 16279 | * |
| 16280 | */ |
| 16281 | function urlResolve(url) { |
| 16282 | var href = url; |
| 16283 | |
| 16284 | if (msie) { |
| 16285 | // Normalize before parse. Refer Implementation Notes on why this is |
| 16286 | // done in two steps on IE. |
| 16287 | urlParsingNode.setAttribute("href", href); |
| 16288 | href = urlParsingNode.href; |
| 16289 | } |
| 16290 | |
| 16291 | urlParsingNode.setAttribute('href', href); |
| 16292 | |
| 16293 | // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils |
| 16294 | return { |
| 16295 | href: urlParsingNode.href, |
| 16296 | protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', |
| 16297 | host: urlParsingNode.host, |
| 16298 | search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', |
| 16299 | hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', |
| 16300 | hostname: urlParsingNode.hostname, |
| 16301 | port: urlParsingNode.port, |
| 16302 | pathname: (urlParsingNode.pathname.charAt(0) === '/') |
| 16303 | ? urlParsingNode.pathname |
| 16304 | : '/' + urlParsingNode.pathname |
| 16305 | }; |
| 16306 | } |
| 16307 | |
| 16308 | /** |
| 16309 | * Parse a request URL and determine whether this is a same-origin request as the application document. |
no outgoing calls
no test coverage detected