Presentation is loading. Please wait.

Presentation is loading. Please wait.

Java Script. What is JavaScript ? It is an scripting language, developed by Netscape Navigator. It can be used to replace CGI scripts for client-side.

Similar presentations


Presentation on theme: "Java Script. What is JavaScript ? It is an scripting language, developed by Netscape Navigator. It can be used to replace CGI scripts for client-side."— Presentation transcript:

1 Java Script

2 What is JavaScript ? It is an scripting language, developed by Netscape Navigator. It can be used to replace CGI scripts for client-side processing with lower bandwidth demands and decreasing server load for busy Web servers. JavaScript is an Interpreted Language It can be used to perform repetitive tasks, it can be ideally used for calculating the content of a form based on changes of the data in another field.

3 What is JavaScript ? Like other scripting language JavaScript is free of development and troubleshooting because it doesn’t need to get compiled. JavaScript is not fully extensible. It has limited set of base objects, properties, methods and data types, which provide enough capabilities to create client-side or server-side applications.

4 Pros and Cons Development – JavaScript does not require time-consuming compilation, scripting can be developed ion a very short period of time. Adaptability – JavaScript doesn’t include complex syntax commands Platform independence – JavaScript is platform independent and can be used on any for which Navigator 2.0 available Less Overheads – JavaScript programs are usually small and less complicated as compared to Java Applets.

5 Pros and Cons Limited Built-in Methods – JavaScript has a very limited set of built-in methods. Code security – As JavaScript is used with the HTML file the possibility of providing security to the coding part of the program is less, there is no way to protect the code from being copied and reused. Lack of debugging facility – Some HTML editors support debugging but not as those available for C,C++.

6 JavaScript in HTML The tags used to begin and end a script are: – and tags. The script tag takes two basic attributes, which determine how the JavaScript is incorporated into the HTML file. AttributeDescription SRC LANGUAGE URL for a file containing JavaScript source code. The file should have an extension.js This attribute indicates the language used in the Script.

7 JavaScript in HTML The opening tag should appear like this: The language=“JavaScript” command is there so the browser can tell the code that follows is in JavaScript and not another scripting language, e.g. VBScript. JavaScriptcode……

8 Adding of JavaScript JavaScript scripts and programs can be included in the header or body section of an HTML file. Here is an example below: // Write a heading document.write(" This is a heading "); // Write two paragraphs: document.write(" This is a paragraph. "); document.write(" This is another paragraph. ");


Download ppt "Java Script. What is JavaScript ? It is an scripting language, developed by Netscape Navigator. It can be used to replace CGI scripts for client-side."

Similar presentations


Ads by Google