• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Javascript
 

Javascript

on

  • 1,491 views

 

Statistics

Views

Total Views
1,491
Views on SlideShare
1,491
Embed Views
0

Actions

Likes
1
Downloads
1
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Javascript Javascript Presentation Transcript

    • Javascript * JavaScript is the most popular scripting language on the internet, and works in all major browsers, such as Internet Explorer, Firefox, Chrome, Opera, and Safari. * JavaScript was designed to add interactivity to HTML pages * A scripting language is a lightweight programming language * JavaScript is usually embedded directly into HTML pages * JavaScript is an interpreted language (means that scripts execute without preliminary compilation)
    • Uses * JavaScript gives HTML designers a programming tool. * JavaScript can put dynamic text into an HTML page. * JavaScript can react to events. * JavaScript can read and write HTML elements. * JavaScript can be used to validate data. * JavaScript can be used to detect the visitor's browser. * JavaScript can be used to create cookies.
    • Javascript Statements * Javascript is a sequence of statements to be executed by the browser. * A JavaScript statement is a command to a browser. The purpose of the command is to tell the browser what to do. * This JavaScript statement tells the browser to write "Hello Dolly" to the web page: document.write("Hello Dolly");
    • HTML tags in javascript The example below shows how to add HTML tags to the JavaScript: <html> <body> <script type=&quot;text/javascript&quot;> document.write(&quot;<h1>Hello World!</h1>&quot;); </script> </body> </html> The document.write command is a standard JavaScript command for writing output to a page.
    • Javascript Comments Comments can be added to explain the JavaScript, or to make the code more readable. Example for comments: <script type=&quot;text/javascript&quot;> // Write a heading document.write(&quot;<h1>This is a heading</h1>&quot;); // Write two paragraphs: document.write(&quot;<p>This is a paragraph.</p>&quot;); document.write(&quot;<p>This is another paragraph.</p>&quot;); </script>
    • Advantages * Advantages include Cross-browser support, validating data on the client, and being able to create more sophisticated user interfaces. * JavaScript is an excellent solution to implement when validating input forms on the client side. * This means that if a user forgets to enter his name in a form for instance a JavaScript validation function can popup a message to let him know about the omission. * JavaScript effects are also much faster to download than some other front-end technologies like Flash and Java applets.