* * 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)
| 18366 | * |
| 18367 | */ |
| 18368 | function urlResolve(url) { |
| 18369 | var href = url; |
| 18370 | |
| 18371 | if (msie) { |
| 18372 | // Normalize before parse. Refer Implementation Notes on why this is |
| 18373 | // done in two steps on IE. |
| 18374 | urlParsingNode.setAttribute("href", href); |
| 18375 | href = urlParsingNode.href; |
| 18376 | } |
| 18377 | |
| 18378 | urlParsingNode.setAttribute('href', href); |
| 18379 | |
| 18380 | // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils |
| 18381 | return { |
| 18382 | href: urlParsingNode.href, |
| 18383 | protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', |
| 18384 | host: urlParsingNode.host, |
| 18385 | search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', |
| 18386 | hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', |
| 18387 | hostname: urlParsingNode.hostname, |
| 18388 | port: urlParsingNode.port, |
| 18389 | pathname: (urlParsingNode.pathname.charAt(0) === '/') |
| 18390 | ? urlParsingNode.pathname |
| 18391 | : '/' + urlParsingNode.pathname |
| 18392 | }; |
| 18393 | } |
| 18394 | |
| 18395 | /** |
| 18396 | * Parse a request URL and determine whether this is a same-origin request as the application document. |
no outgoing calls
no test coverage detected