Javascript: Objects Chapter Four Web Application Development [email_address]
Agenda <ul><li>Introduction  </li></ul><ul><li>Math  Object  </li></ul><ul><li>String  Object  </li></ul><ul><li>Date  Obj...
Math  Object <ul><li>Math  object methods allow you  to perform  many common  mathematical calculations . </li></ul><ul><l...
Math Object Methods  of 20
Properties of the  Math  object.  of 20
Math Object Example <ul><li>Generating a random number from 0…10, inclusive. ( randomNumber1.html ) </li></ul><ul><li>Gene...
String  Object <ul><li>A string is a series of characters treated as a single unit </li></ul><ul><li>A string may include ...
Some  String  object methods  of 20
… Some  String  object methods  of 20
String Objects - Examples <ul><li>To Uppercase, Split and Sub String  SplitAndSubString </li></ul> of 20
Date  Object <ul><li>Date  object provides methods for date and time manipulations </li></ul><ul><li>A constructor is an i...
Date  Object Methods  of 20
Date  Object Methods  of 20
Date Object - Example <ul><li>Date and Time ( DateTime.html ) </li></ul><ul><li>Alarm Clock http://www.javascriptkit.com/s...
Document Object <ul><li>document  object  </li></ul><ul><ul><li>For manipulating the document that is currently visible in...
Important  document  object methods and properties.  of 20
window  Object <ul><li>window  object provides methods for manipulating browser windows </li></ul><ul><li>window  object  ...
… window  Object <ul><li>window  object  closed  property  </li></ul><ul><ul><li>Contains a boolean value that is  true  i...
… window  Object properties  of 20
Window Object - Example <ul><li>(Window.html)  </li></ul> of 20
Upcoming SlideShare
Loading in …5
×

Javascript - Getting Good with Object

563 views

Published on

Getting Good with Object

Published in: Education, Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
563
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
10
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Javascript - Getting Good with Object

  1. 1. Javascript: Objects Chapter Four Web Application Development [email_address]
  2. 2. Agenda <ul><li>Introduction </li></ul><ul><li>Math Object </li></ul><ul><li>String Object </li></ul><ul><li>Date Object </li></ul><ul><li>document Object </li></ul><ul><li>window Object </li></ul> of 20
  3. 3. Math Object <ul><li>Math object methods allow you to perform many common mathematical calculations . </li></ul><ul><li>An object’s methods are called by writing the name of the object followed by a dot operator ( . ) and the name of the method </li></ul><ul><li>In parentheses following the method name is the argument (or a comma-separated list of arguments) to the method </li></ul> of 20
  4. 4. Math Object Methods of 20
  5. 5. Properties of the Math object. of 20
  6. 6. Math Object Example <ul><li>Generating a random number from 0…10, inclusive. ( randomNumber1.html ) </li></ul><ul><li>Generating a random number from 10…20, inclusive. ( randomNumber2.html ) </li></ul> of 20
  7. 7. String Object <ul><li>A string is a series of characters treated as a single unit </li></ul><ul><li>A string may include letters, digits and various special characters, such as + , - , * , / , and $ </li></ul><ul><li>JavaScript supports Unicode, which represents a large portion of the world’s languages </li></ul><ul><li>String literals or string constants (often called anonymous String objects) are written as a sequence of characters in double quotation marks or single quotation marks </li></ul> of 20
  8. 8. Some String object methods of 20
  9. 9. … Some String object methods of 20
  10. 10. String Objects - Examples <ul><li>To Uppercase, Split and Sub String SplitAndSubString </li></ul> of 20
  11. 11. Date Object <ul><li>Date object provides methods for date and time manipulations </li></ul><ul><li>A constructor is an initializer method for an object </li></ul><ul><li>Called automatically when an object is allocated with new </li></ul><ul><li>The Date constructor with no arguments initializes the Date object with the local computer’s current date and time </li></ul><ul><li>Can also create a new Date object by supplying arguments to the Date constructor for year, month, date, hours, minutes, seconds and milliseconds. </li></ul> of 20
  12. 12. Date Object Methods of 20
  13. 13. Date Object Methods of 20
  14. 14. Date Object - Example <ul><li>Date and Time ( DateTime.html ) </li></ul><ul><li>Alarm Clock http://www.javascriptkit.com/script/script2/alarm.shtml </li></ul> of 20
  15. 15. Document Object <ul><li>document object </li></ul><ul><ul><li>For manipulating the document that is currently visible in the browser window </li></ul></ul> of 20
  16. 16. Important document object methods and properties. of 20
  17. 17. window Object <ul><li>window object provides methods for manipulating browser windows </li></ul><ul><li>window object open method </li></ul><ul><ul><li>Creates a window </li></ul></ul><ul><ul><li>Three parameters—the URL of the page to open in the new window, the name of the window, a string of comma-separated, all-lowercase feature names, each followed by an = sign and either &quot;yes&quot; or &quot;no&quot; to determine whether that feature should be displayed in the new window </li></ul></ul><ul><ul><li>If these parameters are omitted, the browser defaults to a new window containing an empty page, no title and all features visible. </li></ul></ul> of 20
  18. 18. … window Object <ul><li>window object closed property </li></ul><ul><ul><li>Contains a boolean value that is true if the window is closed and false if the window is open </li></ul></ul><ul><li>close method </li></ul><ul><ul><li>Closes the current window and deletes its object from memory </li></ul></ul><ul><li>location property </li></ul><ul><ul><li>contains a string representation of the URL displayed in the current window </li></ul></ul> of 20
  19. 19. … window Object properties of 20
  20. 20. Window Object - Example <ul><li>(Window.html) </li></ul> of 20

×