Showing posts with label JavaScript. Show all posts
Showing posts with label JavaScript. Show all posts

JavaScript-program 2

JavaScript is not work in all browsers. These browsers do not show
all the elements or writings within the <Script>.......</Script>
. So to make JavaScript usefull for all browsers, we have to use non script tag.
The non script tag is <!--begin hiding Javascript
and it is end with //End hiding JavaScript--> .
Actually it is comment code that hide the JavaScript from the browsers
those do not support JavaScript. Browsers that support the JavaScript language just ignore the Comment.
You can only use <!-- and end the code as //-->

Here is the Total code:

<html>

<head>

<title>JavaScript</title>

</head>

<body>

<Script Language="JavaScript">

<!--Begin hiding JavaScript

document.write("Welcome to Java World")

//End hiding JavaScript-->

</Script>

</body>

</html>

Posted in Labels: | 0 comments

JavaScript-program 1

How to use JavaScript?

In the introductory post of JavaScript language, I write about
how to write the JavaScript language. Here is an elaborated part
of that post.

<html>

<head>

<title>JavaScript</title>

</head>

<body>

<Script Language="JavaScript">

document.write("Welcome to Java World")

</Script>

</body>

</html>

  • Explanation

  1. <Script Language="JavaScript"> is used for creating JavaScript
    environment. Actually it is the start of JavaScript lanuage

  2. document.write("Welcome to Java World")
    document.write is used for writing anything with JavaScript.
    The syntax isdocument.write("......."). Write anything within the brackets.

  3. There is another syntax that is used to write in JavaScript. This is

    document.writeln("......."). (writeln is for write line)

  4. </Script> is used to close the JavaScript

Posted in Labels: | 0 comments

JavaScript

JavaScript is developed from Java and it is more simpler than Java language.
We can use JavaScript to design webpage. JavaScript is used within HTML language.
To write JavaScript follow the following steps:


  • Open NotePad or WordPad

  • Write

    <html>

    <head>

    <title>JavaScript</title>

    </head>

    <body>

    <Script Language="JavaScript">

    document.write("Welcome to Java World")
    </Script>

    </body>
    </html>

  • Then Save it as JavaScript.html. Remember you have to save the program with .html extension

Posted in Labels: | 0 comments
My Google Pagerank

Followers

Recent Activities

  © 2009; webmaster: MAKE MONEY ONLINE

Back to TOP