1. Get URL
You can directly use location to obtain the URL. Window. Location or window. loation. href can also be used.
2. Analyze the URLIf the attribute of the URL obtained using location is an object, you need to convert it into a
ArticleDirectory
Syntax:
Instance:
For... in declaration is used to traverse the attributes of an array or object (loop operation on attributes of an array or object ).Instance
For... in statement
How to Use the for... in
Object. setcapture () when an object is setcapture, its methods will be inherited to the entire document for capture.Object. releasecapture ()
Mozilla also has similar functions, with slightly different methodsWindow. captureevents (event.
I am very happy and excited to tell you that another classic will soon be born on the journey of the blog Park-Understanding JavaScript! This book originated from a popular blog published by Mr. Li Zhan.
24382Everyone gave a very high comment on
1. img src refresh[Analysis description] first look at the Code:
Src = "aa.jpg" style = "cursor: Pointer"/>In IE, this code can be used to refresh the image, but not in Firefox. It is mainly about caching.[Compatible processing] Add a random number
JavaScript to get the window height and width
Visible area width of the webpage: "+ document. Body. clientwidth;Visible area Height: "+ document. Body. clientheight;Visible area width of the webpage: "+ document. Body. offsetwidth +" (including the
Index of the selected node:Tree. selectednodeindex
Index of the clicked node:Tree. clickednodeindex
Get a node:Tree. gettreenode (nodeindex)
Add a subnode under the root node:VaR tree = Document. All ['treeview1'];VaR node = tree. createtreenode (
Compile the thread code in JavaScript to reference concurrent. thread. js.
Http://jsthread.sourceforge.net/cgi-bin/wiki/wiki.cgi#p0
Download and use the source code immediately! Assume that you have saved the downloaded source code to a folder
The use of JavaScript
A friend of mine asked me a few days ago: "You have a dynamic timetable on your personal homepage. I like it very much. I wonder how you made it? Probably used quite repeatedly
Miscellaneous programs !" "You
Cookies are used to identify users.Instance
Create a welcome cookie
Create a javascript cookie using the data entered in the prompt box. When the user visits the page again, send a welcome message based on the information in the cookie.
Math (arithmetic) objects are used to execute common arithmetic tasks.Instance
Round ()
How to use round ().
Random ()
How to use random () to return a random number between 0 and 1.
Max ()
How to Use max ()
I recently read "Advanced guide for high-performance website construction", Chapter 7 is "Writing efficient JavaScript", and the author is Nicholas C. zakas (also author of JavaScript advanced programming) describes the optimization of string
// Example 1 var A = 10086; function F1 () {alert (a) ;}f1 (); // 999 // Example 2: when the internal variable of the function is declared, you must use var. Otherwise, a global variable function F2 () {var B = 10086;} F2 (); alert (B); // errer: B
Axial is an open-source project on codeplex. We can use it to implement Javascript in C # Or VB. NET mode, and then it will automatically output the corresponding JavaScript to the client. Some form controls can be used for input verification, some
The following describes how to determine whether a Javascript file is fully loaded or whether all JS files on the page are fully loaded:
function loadScript(url , callback){ var script = document.createElement("script");
1. What is an anonymous function?
There are three methods to define a function in javascript:
1. Function keyword (function) Statement:Function fnmethodname (x) {alert (x );}2. Function literals ):VaR fnmethodname = function (x) {alert (x );}3.
Domdocument attributes and Methods
Recently, we found that the domdocument object is very important, and XMLHTTP is also very important.
Note that case sensitivity must not be incorrect.
Attribute:
1 attributes storage node attribute list
In most cases, URLs are a concern of backend programmers, but sometimes they also need to deal with them, one thing that many people may have done is to jump to the page by writing the href attribute, but this is not all the topic to be discussed
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.