* * 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)
| 18842 | * |
| 18843 | */ |
| 18844 | function urlResolve(url) { |
| 18845 | var href = url; |
| 18846 | |
| 18847 | if (msie) { |
| 18848 | // Normalize before parse. Refer Implementation Notes on why this is |
| 18849 | // done in two steps on IE. |
| 18850 | urlParsingNode.setAttribute("href", href); |
| 18851 | href = urlParsingNode.href; |
| 18852 | } |
| 18853 | |
| 18854 | urlParsingNode.setAttribute('href', href); |
| 18855 | |
| 18856 | // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils |
| 18857 | return { |
| 18858 | href: urlParsingNode.href, |
| 18859 | protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', |
| 18860 | host: urlParsingNode.host, |
| 18861 | search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', |
| 18862 | hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', |
| 18863 | hostname: urlParsingNode.hostname, |
| 18864 | port: urlParsingNode.port, |
| 18865 | pathname: (urlParsingNode.pathname.charAt(0) === '/') |
| 18866 | ? urlParsingNode.pathname |
| 18867 | : '/' + urlParsingNode.pathname |
| 18868 | }; |
| 18869 | } |
| 18870 | |
| 18871 | /** |
| 18872 | * Parse a request URL and determine whether this is a same-origin request as the application document. |
no outgoing calls
no test coverage detected