Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Bookmarklet
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Concept == Web browsers use [[Uniform Resource Identifier|URI]]s for the <code>href</code> attribute of the <syntaxhighlight lang="HTML" inline><a></syntaxhighlight> tag and for bookmarks. The URI scheme, such as <code>http</code> or <code>ftp</code>, and which generally specifies the [[Protocol (computing)|protocol]], determines the format of the rest of the string. Browsers also implement <code>javascript:</code> URIs that to a parser is just like any other URI. The browser recognizes the specified <code>''javascript''</code> scheme and treats the rest of the string as a JavaScript program which is then executed. The expression result, if any, is treated as the HTML [[source code]] for a new page displayed in place of the original. The executing script has access to the current page, which it may inspect and change. If the script returns an undefined type (rather than, for example, a string), the browser will not load a new page, with the result that the script simply runs against the current page content. This permits changes such as in-place font size and color changes without a page reload. An [[Immediately invoked function expression|immediately invoked function]] that returns no value or an expression preceded by the <code>void</code> operator will prevent the browser from attempting to parse the result of the evaluation as a snippet of HTML markup: <syntaxhighlight lang="javascript" line="1" start="1"> javascript:(function(){ //Statements returning a non-undefined type, e.g. assignments })(); </syntaxhighlight>
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Bookmarklet
(section)
Add topic