JavaScript is a language developed by Netscape Communications Corporation that is used alongside HTML documents. It allows you to perform interactive tasks, and to retrieve data from a source, process that data and output the result.
JavaScript is embedded within an HTML page, & works well with HTML & most browsers. JavaScript is an object oriented language. JavaScript is not compiled before it is executed. It is an interpreted language, the browser executes each line of JavaScript as it comes. One big problem about JavaScript is that different browsers interpret it different browsers interpret it differently. A script that works well on one browser may work differently from another or even produce errors on some browsers. JavaScript is a scripting language and its syntax is very similar to Java.
Many of the functions of JavaScript can be performed on the server side using CGI( Common Getaway Interface), PHP, ASP, JSP and Cold Fusion. Using this languages on web pages gives then a dynamic feel and requires data to be sent to the server and back to the browser. Server side languages are essential in that they allow data to be written to the database and reading and writing files.
JavaScript doesn't run on the server side.
How to use JavaScript (Basics)
There are three ways to include JavaScript into an HTML document
1. You can include JavaScript between tags inside an HTML document.
This is known as internal JavaScript file. HTML tags tell the browser where the scripting language will begin & end. You can place scripts that are applied to various parts of the document in the <head> </head> tags.
2. The second method is by using an external script that links to the HTML document in the head section of the document using the SRC attribute.
3. The third option is to add JavaScript inside event handler attributes.
No comments:
Post a Comment