Java script writing javascript
Upcoming SlideShare
Loading in...5
×
 

Like this? Share it with your network

Share

Java script writing javascript

on

  • 686 views

 

Statistics

Views

Total Views
686
Views on SlideShare
686
Embed Views
0

Actions

Likes
0
Downloads
2
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

Java script writing javascript Presentation Transcript

  • 1. • Discuss the syntax in writing the JavaScript in the HTML documents.• Apply the basic JavaScript command in displaying text in an HTML documents.
  • 2. • It is an object-oriented, client based scripting language created by Netscape programmer, Brendan Eich.• What can you do using JavaScript?
  • 3. JavaScript syntax<html> <html><head><title>JS<title> <head><title>JS<title></head> </head><script type= “text/javascript”> <script language= “Javascript”>alert(“Welcome to the World alert(“Welcome to the World of Dynamic Programming”); of Dynamic Programming”);</script> </script><body> <body></body> </body></html> </html>
  • 4. The <SCRIPT> and </SCRIPT> tags are the main way of connecting JavaScript code to HTML. You are free to embed as many scripts into a single HTML document as you like using multiple <SCRIPT> tags.Script tags What it does<script language= “JavaScript> Tells your browser that JavaScript code is about to appearalert(“Welcome….”); -Statements (object, properties, function, vari ables , methods, and events. -Semi colon terminates the statements</script> Tells the browser that the JavaScript code is all done and it can go back to HTML code
  • 5. DISPLAYING TEXT• <html>• <body>• <script type= “text/javascript”>• document.write(“Welcome to the World of Dynamic Web Programming!”)• </script>• Note: The word document.write is a standard JavaScript command for displaying text/output in a page.• The entire line document.write(“Welcome…!”) is called as statements• document is the object name and write is the property name.• Notice that a dot (.) is used to separate the object name from a property name. This is the syntax to access the property of an object
  • 6. SUMMARY Writing/Scripting in JavaScript JavaScript code is typically embedded in the HTML, to be interpreted and run by the clients browser. Here are some tips to remember when writing JavaScript commands.• JavaScript appears within the <Head> and <Body> sections of an HTML document.• JavaScript code is case sensitive• White space between words and tabs are ignored• Line breaks are ignored except within a statement• JavaScript statements end with a semi- colon (;)
  • 7. • A JavaScript code is a sequence of statements that can be embedded into an HTML page and executed directly by a Web browser to generate dynamic HTML page.• Scripting in JavaScript entails working with objects, which you can create yourself or use those built-in the language.• You can access information(properties) about the objects, perform actions(methods) on them and responds(event handler) to the events that happen to them.• Objects, properties, methods, and event handlers are the building blocks of JavaScript programs.
  • 8. CompuQuiz/Exercises/Evaluation1. Write the JavaScript Syntax.2. What is the script tag tells the browser that a JavaScript code is about to appear?3. It what part or sections of the HTML documents where script tags can be written?4. What is the basic JavaScript code or command for displaying text in you HTML documents?5. What symbols it use to terminate a JavaScript statements?
  • 9. Assignment1. Research on the following JavaScript commands.• Alert• Confirm2. What is the purpose of the alert and confirm script commands in a web page?