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 Chat (such as one of these permanent autoconfirmed members).
URL schemes: Difference between revisions
No edit summary |
(define javascript: URLs) |
||
Line 38: | Line 38: | ||
See also [http://tools.ietf.org/html/rfc6694 The "about" URI Scheme] and [http://www.iana.org/assignments/about-uri-tokens/about-uri-tokens.xml "about" URI Tokens] which this wiki page obsoletes. | See also [http://tools.ietf.org/html/rfc6694 The "about" URI Scheme] and [http://www.iana.org/assignments/about-uri-tokens/about-uri-tokens.xml "about" URI Tokens] which this wiki page obsoletes. | ||
== javascript: URLs == | |||
'''javascript: URLs''' represent a JavaScript script. | |||
To '''obtain a script''' from a javascript: URL, run these steps: | |||
* Let ''input'' be the concatenation of URL's scheme data, followed by "?" and URL's query if URL's query is non-null, followed by "#" and URL's fragment if URL's fragment is non-null. | |||
* Set ''input'' to the result of [http://url.spec.whatwg.org/#percent-decode percent decoding] ''input''. | |||
* If ''input'' starts with a U+FEFF, remove a single occurrence from the start of ''input''. | |||
* Return ''input''. | |||
See also [http://tools.ietf.org/html/draft-hoehrmann-javascript-scheme The 'javascript' resource identifier scheme] which this wiki page obsoletes. | |||
== Others == | == Others == | ||
* [http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol ws: & wss:] | * [http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol ws: & wss:] | ||
* See [http://en.wikipedia.org/wiki/URI_scheme Wikipedia] | * See [http://en.wikipedia.org/wiki/URI_scheme Wikipedia] |
Revision as of 13:25, 28 November 2012
Licensing: this page is under CC0, not the MIT License.
about: URLs
about: URLs serve as identifier, potentially with an associated resource. The identifier is given in the URL's scheme data.
Identifier | Resource | Notes |
---|---|---|
"blank" | A resource whose Content-Type is text/html;charset=utf-8 and entity body is the empty string. | |
"invalid" | - | Used to represent a network error. See also CSS Values and Units. |
"legacy-compat" | - | Used in HTML for XSLT serializers. |
"srcdoc" | - | Used in HTML for its <iframe srcdoc> feature. |
"unicorn" | A resource whose Content-Type is image/svg+xml and entity body is the contents of unicorn.svg. | Unicorn! |
To obtain a resource from an about: URL, run these steps:
- If URL's scheme data is not the literal string "about" or "invalid", return a network error. (URL's query is simply not taken into account and can be anything.)
- Return the resource corresponding to the identifier as listed in the table above, with HTTP status code 200 and HTTP status text "OK".
See also The "about" URI Scheme and "about" URI Tokens which this wiki page obsoletes.
javascript: URLs
javascript: URLs represent a JavaScript script.
To obtain a script from a javascript: URL, run these steps:
- Let input be the concatenation of URL's scheme data, followed by "?" and URL's query if URL's query is non-null, followed by "#" and URL's fragment if URL's fragment is non-null.
- Set input to the result of percent decoding input.
- If input starts with a U+FEFF, remove a single occurrence from the start of input.
- Return input.
See also The 'javascript' resource identifier scheme which this wiki page obsoletes.
Others
- ws: & wss:
- See Wikipedia
- See IANA