JavaScript-program 2
Posted On Friday, June 12, 2009 at at 12:21 AM by RashedJavaScript 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>
JavaScript-program 1
Posted On at at 12:17 AM by RashedHow 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
- <Script Language="JavaScript"> is used for creating JavaScript
environment. Actually it is the start of JavaScript lanuage - document.write("Welcome to Java World")
document.write is used for writing anything with JavaScript.
The syntax isdocument.write("......."). Write anything within the brackets. - There is another syntax that is used to write in JavaScript. This is
document.writeln("......."). (writeln is for write line) - </Script> is used to close the JavaScript
JavaScript
Posted On at at 12:13 AM by RashedJavaScript 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