JavaScript Web Authoring Effects

Source: Internet
Author: User

A. What is JavaScript? scripting language for Web interaction effects. Effect two. BOM objects enable JavaScript and the browser to talk. The main operation is using the Window object. History object: Historical, can be realized forward backwards back (): Backward a page, return to the upper page forward (): forward a page. Go (N): if (n==0) flush else if (n>0) forward n pages else if (n<0) back n pages lacation object: Mainly for address bar address. Can implement page jump, function similar to, a tag. href (): Sets or returns the address. Similar to the can jump page reload (): Refreshes the current page Document object: document.write (); Displays some content on the page. Manipulate the contents of the body. Write (): writes the corresponding content inside the body. getElementById: Must be written in the method, because it is necessary to trigger such a thing to perform the effect. Getelementsbyname: Gets all the names for the specified name of the element, returning the length three. Window object: Three pop-up windows. Open (): Opens a new window. Close (): Close closes the current window. SetTimeout (): Executes a function after a certain time. Can only be performed once. In this time, it is measured in milliseconds. 1000 equals 1 seconds setinterval () How much time to execute the function once. This function is executed several times. Four. JavaScript built-in object string handling of strings. The Length property, which returns the lengths of the strings. Split (str) splits a string into an array of strings tolowercase () converts the string to lowercase touppercase () converts the string to uppercase var B = A.charat (0);//by subscript to find the character in the corresponding string var b = A.indexof ("a", 11);//start looking for the first specified string from the specified subscript after the specified string var b = A.substr (0,3);//That is, returns the string labeled 0, 1, 2 in the string var b = A.substr (5,8) ;//Includes the previous item, excluding the last date date, the processing date getdate () returns each day of the one month of the date object with a value between 1~31 getday () returns the day of the week of the date object with a value between 0~6 0-Sunday, 1-Monday, 2 -Tuesday .... 6-Saturday gethours () back to DaThe number of hours of the Te object whose value is between 0~23 getminutes () returns the number of minutes of the date object, whose value is between 0~59 getseconds () returns the number of seconds of the date object with a value between 0~59 () that returns the month of the date object. Its value is between 0~11 and starting from 0, 0月-January, January-February ... getfullyear () returns the year of the Date object with a value of 4 digits gettime () returns the number of milliseconds since a time (January 1, 1970) array Math Math task five, The array uses a variable that references multiple arrays. 1. Create an array, var array name = new Array ();//Create an empty array var array name = new Array (size);//Create an array of magnitude, content null, var array name = new Array (value 1, value 2, value 3 ...). .);/ /create an array, and give initialization 2. Assignment: var array name = new Array (value 1, value 2, value 3 ...); var array name = new Array (), array name [subscript] = value, var array name = [value 1, Value 2, value 3 ...]; 3. Reading of the array: single read, read by subscript. Read all, through for or for...in. 4. A two-D array takes an array as an element of an array, forming a new array. VI. Use JavaScript to modify the label style to get the label through getElementById. Then pass the label. Style. Style Property = value. Display: Hide tags. none | Block VII, Summary: 1. Four built-in objects commonly used by javascript: String Date Math Array2. How to use JavaScript to change the label style A, getElementById to get the label B,. style, name = "Value", and 3. In the CSS style, many are with "-", in JavaScript does not recognize "-" css:background-colorjavascript:backgroundcolor

JavaScript Web Authoring effects

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.