Free Web Designing Courses

   »   

Computer Education, Training & Tutorial Resources - ComputerEducationWorld.com
Home » Free Web Designing Courses »

An alert box is a small window that pops up with a yellow warning sign and a (usually) important message. With JavaScript we can either show a message to the user either before a page loads or in response to a user action. Here we will make an alert box that appears before the page loads. It will look like this: (more…)


• • •
 

<script language=”JavaScript”>
<!–
document.writeln(”Hello, welcome to my page.” );
//–>
</script>

Insert the above into your html document between the <body> and </body> tags. The piece of text (known as a string) between the parentheses is the parameter given to the writeln() method. The browser will display the HTML between the parentheses when it runs the script. (more…)


• • •
 

Some older browsers do not recognize JavaScript. These browsers would sometimes display JavaScript code in the page as if it were part of the contents of the page. Therefore, it is conventional to place JavaScript code between comment tags as follows:

Code (javascript)
  1.  
  2. <script>
  3.  
  4. <!–..JavaScript code goes here..
  5.  
  6. //–>
  7.  
  8. </script>
  9.  
  10.  

Older browsers would just ignore the Javascript code between the <!– and –> comment tags, while new browsers would recognize it as JavaScript code. The // just before the end comment tag –> is a JavaScript comment symbol, and tells the browser not to execute the end comment tag –> as JavaScript. Using comment tags makes a webpage more accessible to older browsers.


• • •
 

It’s important to understand the difference between Java and JavaScript. Java is a full programming language developed by Sun Microsystems with formal structures, etc. JavaScript is a scripting language developed by Netscape that is used to modify web pages. Most JavaScript must be written in the HTML document between <SCRIPT> tags. You open with a <SCRIPT> tag, write your JavaScript, and write a closing </SCRIPT> tag. Sometimes, as an attribute to script, you may add “Language=JavaScript” because there are other scripting languages as well as JavaScript that can be used in HTML. (more…)


• • •
 



captcha PHP Script Free PHP captcha script free php
Website Design by WebWalas.com