JavaScript

From Wikipedia, the free encyclopedia
(Redirected from Javascript)
Jump to: navigation, search

JavaScript is a scripting language for computers. It is often run in web browser applications to create dynamic content like message boxes popping up or a live clock. It is not related to and is different from the programming language Java.

[change] Example

The following script writes "Example" on the screen:

<script type="text/javascript">
function example()
{
    var ex = document.createTextNode('Example');
    document.body.appendChild(ex);
}
example();
 
/*
 * The code below does almost the same thing as the code above, 
 * but it shows "Example" in a popup box and is shorter.
 */
 
alert("Example");
</script>

The JavaScript is enclosed by <script> </script> tags, to tell that it is a script and not text.

[change] Other pages

[change] Other websites

Wikibooks-logo-en.svg
The English Wikibooks has more about this subject:
Personal tools
Namespaces

Variants
Actions
Getting around
Print/export
Toolbox
In other languages