A user account is required in order to edit this wiki, but we've had to disable public user registrations due to spam.

To request an account, ask an autoconfirmed user on IRC (such as one of these permanent autoconfirmed members).

Difference between revisions of "URL"

From WHATWG Wiki
Jump to: navigation, search
(Implementations)
(Tests)
Line 13: Line 13:
  
 
* https://github.com/cweb/iri-tests
 
* https://github.com/cweb/iri-tests
 +
 +
Variants of the following code (runs in Live DOM Viewer) are useful to test which code points are URL escaped in browsers:
 +
<pre><!DOCTYPE html>
 +
<script>
 +
var a = document.createElement("a")
 +
 +
i = 0
 +
cp = 0x100
 +
 +
while ( i < cp ) {
 +
  a.href = "http://x" + String.fromCharCode(i) + "@x/"
 +
  if(a.href.length != "http://x)@x/".length) {
 +
    w(a.href)
 +
  }
 +
  i++
 +
}
 +
</script></pre>
  
 
==Parsing==
 
==Parsing==

Revision as of 14:31, 26 October 2012

This documents research and notes around URLs for the URL standard.

Implementations

Tests

Variants of the following code (runs in Live DOM Viewer) are useful to test which code points are URL escaped in browsers:

<!DOCTYPE html>
<script>
var a = document.createElement("a")

i = 0
cp = 0x100

while ( i < cp ) {
  a.href = "http://x" + String.fromCharCode(i) + "@x/"
  if(a.href.length != "http://x)@x/".length) {
    w(a.href)
  }
  i++
}
</script>

Parsing

JavaScript libraries

For improving the API we might want to take inspiration from: