Thursday, June 21, 2012

Web systems day 05-Topic: JavaScript Objects

I JavaScript Objects

1. Facts about JavaScript objects
  • An object is just a special kind of data. An object has properties and methods.
  • The String object is used to manipulate a stored piece of text.
  • The Date object is used to work with dates and times.
  • The Array object is used to store multiple values in a single variable.
  • The Boolean object is used to convert a non-Boolean value to a Boolean value (true or false).
  • The Math object allows you to perform mathematical tasks.
  • The regular expression (RegExp) Object.
2. Properties are the values associated with an object.

3. Methods are the actions that can be performed on objects.

4. String object

5. Date object
6. Array object
  • An array is a special variable, which can hold more than one value, at a time.
7. Boolean object

8. Math Object

9. RegExp Object
  • A regular expression is an object that describes a pattern of characters.
  • When you search in a text, you can use a pattern to describe what you are searching for.
  • A simple pattern can be one single character.
  • A more complicated pattern can consist of more characters, and can be used for parsing, format checking, substitution and more.
  • Regular expressions are used to perform powerful pattern-matching and "search-and-replace" functions on text.

II. JavaScript Advance
  • The Navigator object contains information about the visitor's browser.
  • A cookie is often used to identify a user.
  • A cookie is a variable that is stored on the visitor's computer. Each time the same computer requests a page with a browser, it will send the cookie too. With JavaScript, you can both create and retrieve cookie values.
1. JavaScript Browser Detection

The Navigator Object


2. JavaScript Cookies


References
  1. Wendy Willard (2010). Web Design DeMYSTiFieD. McGraw-Hill Osborne Media
  2. http://www.w3schools.com/ accessed date 21 June 2012

No comments:

Post a Comment

Mounting USB drives in Windows Subsystem for Linux

Windows Subsystem for Linux can use (mount): SD card USB drives CD drives (CDFS) Network drives UNC paths Local storage / drives Drives form...