* * 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)
| 17953 | * |
| 17954 | */ |
| 17955 | function urlResolve(url) { |
| 17956 | var href = url; |
| 17957 | |
| 17958 | if (msie) { |
| 17959 | // Normalize before parse. Refer Implementation Notes on why this is |
| 17960 | // done in two steps on IE. |
| 17961 | urlParsingNode.setAttribute("href", href); |
| 17962 | href = urlParsingNode.href; |
| 17963 | } |
| 17964 | |
| 17965 | urlParsingNode.setAttribute('href', href); |
| 17966 | |
| 17967 | // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils |
| 17968 | return { |
| 17969 | href: urlParsingNode.href, |
| 17970 | protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', |
| 17971 | host: urlParsingNode.host, |
| 17972 | search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', |
| 17973 | hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', |
| 17974 | hostname: urlParsingNode.hostname, |
| 17975 | port: urlParsingNode.port, |
| 17976 | pathname: (urlParsingNode.pathname.charAt(0) === '/') |
| 17977 | ? urlParsingNode.pathname |
| 17978 | : '/' + urlParsingNode.pathname |
| 17979 | }; |
| 17980 | } |
| 17981 | |
| 17982 | /** |
| 17983 | * Parse a request URL and determine whether this is a same-origin request as the application document. |
no outgoing calls
no test coverage detected