JavaScript basics and common objects
*********************************************************** ****************************
This chapter includes
◆ Simply introduce the object-attributes and methods processed by JavaScript, JavaScript;
◆ JavaScript code joins the method in the HTML document;
◆ An example of JavaScript's most common scenario - Verify user input;
◆ JavaScript document object model diagram;
◆ JavaScript string object and date object;
◆ Window objects and frame windows (Frameset, iframe);
◆ Regular expression mode (Pattern) match - Verify user input;
◆ Refer to JavaScript code: The dynamic variation effect of the navigation button is pre-loaded.
◆ Refer to JavaScript code: display the information of the object;
◆ Refer to JavaScript code: beautiful calendar;
◆ Refer to JavaScript code: drop-down menu;
◆ Refer to JavaScript code: Tree map similar to the resource manager;
*********************************************************** ****************************
In order to provide end users to use convenience, beautiful user feels, many specific client programs are tended to tend to adopt browser client applications. Early static, lack of interactive HTML page documentation is not available. JavaScript is an object-based scripting language and is a program language on the Browser. When the web server outputs content (including JavaScript program code) to the browser, JavaScript can manipulate everything on the browser, providing user interaction, interface beauty, and increasing the "intelligence" of the web interface.
7.1 Learn about the program language on the JavaScript - browser
JavaScript is a scripting language that is used with HTML documents, and the web server generates an output HTML content, and some JavaScript program code to the browser client. JavaScript interprets the browser, different browsers, or different versions of the same browser, have some differences in JavaScript support. This book does not discuss these issues and assume that users use IE5.0 or higher browsers. JavaScript is an object-based language that operates an object-Access or sets an object's properties, and writes a specific event (method) code for objects.
7.1.1 Simple introduction of the object of JavaScript - Properties and Methods
Objects in JavaScript are composed of two basic elements of properties and methods (Methods). The former is an object to implement the loading unit of the information in the process of implementing it, thereby associating with the variable; the latter means that the object can be performed in accordance with the designer's intention, thereby associating a particular function.
Where is the object from? JavaScript can operate with the following three sources:
■ Existing objects (links, images, plugins, HTML form elements, browser details, etc.), browser environment and HTML tag statements;
■ Objects created by JavaScript built-in classes such as Data (Date) and Number; ■ Objects created by users by JavaScript;