Presentation is loading. Please wait.

Presentation is loading. Please wait.

Javascript Languages By Rapee kamoltalapisek ID: 49541188.

Similar presentations


Presentation on theme: "Javascript Languages By Rapee kamoltalapisek ID: 49541188."— Presentation transcript:

1 Javascript Languages By Rapee kamoltalapisek ID: 49541188

2 History Netscape 2 was released in early 1996 and offered completely new technologies created by the Netscape group, the most important of which were frames and JavaScript. JavaScript was a programming language written by Brendan Eich that was able to be embedded in Web pages and could process numbers and modify the contents of forms. While in development, JavaScript had been known as LiveWire then LiveScript. Its core script syntax closely resembled Java, so it was renamed JavaScript when it was released. The way it referenced forms, links and anchors as children of the document object, and inputs as children of their parent form became known as the DOM level 0.

3 Description The same year, Netscape passed their JavaScript language to the European Computer Manufacturers Association (ECMA) for standardisation. The ECMA produced the ECMAscript standard, which embodied the JavaScript core syntax, but did not specify all aspects of the DOM level 0. With the release of Netscape 3 later in the same year, Netscape had produced JavaScript 1.1, which could also change the location of images, bringing on a wave of Web sites that used this most popular of Web page effects, making images change when the mouse passed over them. The images were also referenced as children of the document object and thus the DOM level 0 was completed.

4 Example code Syntax <!-- document.write("JavaScript is not Java"); -->

5 This results is : JavaScript is not Java The above example is how you write text to a web page using JavaScript.

6 Explanation of code 1. The tags tell the browser to expect a script in between them. You specify the language using the type attribute. The most popular scripting language on the web is JavaScript.

7 Explanation of code 2. The bits that look like HTML comments tag ( ) are just that - HTML comment tags. These are optional but recommended. They tell browsers that don't support JavaScript (or with JavaScript disabled) to ignore the code in between. This prevents the code from being written out to your website users.

8 Explanation of code 3. The part that writes the actual text is only 1 line (document.write("JavaScript is not Java");). This is how you write text to a web page in JavaScript. This is an example of using a JavaScript function (also known as method).

9 Date Example var currentDate = new Date() var day = currentDate.getDate() var month = currentDate.getMonth() var year = currentDate.getFullYear() document.write(" " + day + "/" + month + "/" + year + " ") Results in this... 8/10/2007

10 Time Example var currentTime = new Date() var hours = currentTime.getHours() var minutes = currentTime.getMinutes() if (minutes < 10) minutes = "0" + minutes document.write(" " + hours + ":" + minutes + " " + " ") Results in this... 15:16

11 References http://www.quackit.com/javascript/tutorial/javascript_s yntax.cfm http://javascript.about.com/od/reference/a/history.htm


Download ppt "Javascript Languages By Rapee kamoltalapisek ID: 49541188."

Similar presentations


Ads by Google