JavaScript Recognitions, JavaScript Tutorial, Global Guide Line Technology.
Forum | Blog |

      Home                    

Basic JavaScript Guide.
 JScript Introduction.            
 JScript Why?                       
 JScript Recognitions.
 JScript onMouseover.         
 JScript with Buttons.           
 JScript Alerts.                     
 JScript Variables.               
 JScript Operators.               
 JScript Functions.               
 JScript Prompts.                 
 JScript Conditions.             
 JScript Validations.            
 JScript Confirmation Boxes.
 JScript Browser Detection.  
 JScript Redirection.            
 JScript on Links.                 
 JScript Switch.                    
 JScript Loops.                     
 JScript Events.                    
 JScript Exception Handling.
 JScript Reserve Characters. 
 JScript with Objects.            
 JScript Math Object.           
 JScript using Dates.             
 JScript using String.            
 JScript using Arrays.            
 JScript Operations.              
 JScript Handling Cookies.   
 JScript in Mapping.             
 JScript Time Out.                
 JScript Summary.                

JavaScript Tutorial >> JavaScript Recognitions.


     Back             Next     
In the world of computer programming languages you will examine that the first example of coding comes in just print the " Hello World " on screen and we also follow this tradition and write our first JavaScript showing the Hello World on our monitor screen. It is the beginning of this JavaScript Tutorial.  We will take a little bit of burden over here by just playing to print our messages on our monitor screen.

My First JavaScript Example.

<html>
  <head>
     <title>My First JavaScript Example</title>
  </head>
  <body>
      <script type="text/javascript">
         document.write(" Hello World... ");
      </script>
  </body>
</html>

Out put of above JavaScript.

Hello World...

Explanations of First JavaScript Example.

On the above simplest JavaScript code we can see that how to use JavaScript into an HTML page, we use the <script> tag with its attribute type for defining scripting language. Now, the <script type="text/javascript"> and </script> tells where the JavaScript starts and ends on our web page and in between we can place our JavaScript keywords and use any programming logic...

An other JavaScript Example.

<html>
  <head>
     <title>My Second JavaScript in JavaScript Tutorial</title>
  </head>
  <body>
      <script type="text/javascript">
         <!--
              document.write(" Hello World... ");
          -->
      </script>
  </body>
</html>

The out put  of the above will also be same like the first example's out put.  Next we added an optional HTML comment that surrounds our JavaScript code. If a browser does not support JavaScript, then it will not display our code in plain text to the user as out put. The HTML comments stars with "<!--" and comment was ended with a "-->". This is proffered to use always write your JavaScript in HTML comments.

There are so many different things that can go wrong with a JavaScript, it would be human error, browser compatibility issues, or operating system differences, or some non-supportive functions of JavaScript at that plate form. So whenever using JavaScript, be sure that you test your JavaScript out on a wide variety of systems and most importantly, different web browsers such as Firefox, Internet Explorer, Netscape etc.


     Back             Next     
 

JavaScript Statement, JavaScript Block and JavaScript Comments Examples



[ About ] [ Contact ] [ Home ]
[ Links ] [ Site Map ] [ Services ] [ Privacy ]

Copyright © 2005 -  2023 www.globalguideline.com All rights reserved. (Best viewed in IE 6.0+ or Firefox 2.0+ at 1024 * 768 or higher) 305 visitors are online now