Creating a javascript Block:

JavaScript is a dynamic scripting language that allows you to build interactivity into otherwise static HTML pages. This is done by embedding blocks of JavaScript code almost anywhere in your Web page.

 

To make this work, blocks of JavaScript code are delineated by opening and closing script tags:

 

The script tag takes one important attribute: language.

 

This attribute specifies what scripting language you are using. Typically, its value will be either JavaScript or JavaScript1.0, JavaScript1.1, JavaScript1.2, and so on. By specifying a specific JavaScript version number, you indicate to the browser this script can only run on a browser that supports the specified version of JavaScript. Without that, every JavaScript-capable browser will assume the script is one it should try to run.

 

For instance, the following is an example of a complete script tag:

 

The following steps outline how to create a simple HTML document with a single embedded script block. The script is responsible for outputting the word.

Lets checkout  the steps:

 

1. Open a new HTML document in your preferred HTML or text editor.

 

2. Create the body of the document with opening and closing body

tags:

3. Insert a script block in the body of the document:

 

4. Specify JavaScript as the language for the script tag:

5. Place any JavaScript code in the script block so that the final code looks like Figure.

 

6. Save the file.

 

7. Open the file in your browser. You should see the word “Hello” in your browser, as in Figure.

 

javascript tutorial images make a script block

 

Demos:

http://demos.coolajax.net/javascripts/scriptblock/

 

Download:

http://demos.coolajax.net/javascripts/scriptblock/index.zip



Like our site? Be a member of Coolajax fan page to get daily posts updates!

recommended-tutorial You May Like This Posts!

» Alert Method In Javascript

» Creating a javascript Block

» Nice JavaScript Techniques Using for awesome CSS Styling

» Reserved keywords

Previous tutorial No Preious Post Available!
  tuts_view Total Read: 522
blog comments powered by Disqus

Topics

Coolajax Fans

coolajax fan page on Facebook