There are three methods of obtaining elements in javascript:
1, getElementById () method: Get the HTML element by ID.
2, Getelementsbyname () method: to get the element by name, is an array.
3, getElementsByTagName () method: The HTML tag to get
But parseint ("08", 10) can return 8.
To find out the difference between the two,
Refer to the difference written by others: Parseint&number
parseint
Parses a string argument and returns an integer of the specified radix or base.
Core
These ancient browsers only support a method of registering event handlers, a method that was invented by Netscape. Because Netscape is preemptive, if Microsoft wants to be a browser that supports JavaScript events, it has to follow Netscape, so
The JavaScript array is essentially an object that converts the subscript of an array into a string and uses it as a property, so it is significantly slower than a real array, but it can be used more easily.
Change oneself
three ways to affirm functions (declaring a function)
Method One: function functionname ([parameters]) {functionbody};
Example D1
Copy Code code as follows:
function Add (A, B)
{
return a+b;
}
Alert (Add (1,2)); Produces 3
Sometimes there may be such a demand that I use in the background:
Copy Code code as follows:
Httputility.urlencode (str, System.Text.Encoding.UTF8);
The URL is encoded, the front desk JS need to use this content, this time
If you don't know why, don't worry too much, study CSS rules and view this article: use CSS to fix everything: 20 + common bugs and fixes.
If this is not the case, you can fix it with the 12 JavaScript solutions listed below, so that your Web page
Copy Code code as follows:
var f1 = function (P1,P2,P3) {
Switch (arguments.length) {
Case 0:
Alert ("F1 version of the argument")
Break
Case 1:
Alert ("1-parameter version of F1:" + p1)
Break
Case 2:
Alert ("2-parameter version of
At first, I thought of the Click () event in jquery to trigger the hyperlink's clicked event (the same effect as trigger ("click"). It turned out to be unsatisfactory.
Examples are as follows:
Effect chart
Ie:
FireFox:
Copy Code code as
The principle is basically this, if the incoming is a string, then let them become an element node, but this element node can also have many layers, in the most inner layer of the elements to be wrapped in. There are several ways to turn a string
Javascript does not have private, public access to the keyword set, but can be a certain skill to simulate the same results.
First let's look at the following line of code:
var i = (1, 2, 3, 4, 5);
The final result of the variable i is 5.
This is
about what is anonymous function, and its advantages in this article is not delve into, first throw a common anonymous function:
(function () {alert (' Yo ')}) ()
Many students know how to use this anonymous function, but may not understand why it
Copy Code code as follows:
Http://
JavaScript Validation Form Encyclopedia
1. Length Limit
Copy Code code as follows:
2. Can only be Chinese characters
3. "Can only be English
In JavaScript, arrays are not stored directly as cookies (PHP can), and that is to dump the array into a string, and then save it in a cookie, and we can use either ToString () or join directly on the simple one-dimensional array:
The ToString
When we transmit parameters, we often encounter parameters that send some of the same attributes to the background, and the best option is to use arrays. When we transfer to the background, we simply define and use the array in JavaScript and pass
In this article, the author describes the differences between 7 JavaScript in IE and Firefox.
1. CSS "Float" value
The most basic syntax for accessing a given CSS value is: Object.style.property, using the hump to replace a value with a connector,
Notify & CaptureTo achieve notify and capture is too easy, we just have to save capture incoming handler, and then find a matching notify inside handler on it.
Copy Code code as follows:
var filterhandlerbundles = [];
Take a look at one of the old pros that is not fresh but interesting to the rookie:
What the heck is that? It's a Luan Lun.
New
With the above diagram, let's look at the second question left in the previous article, where we can add
Believe that every developer knows the importance of caching. There is a cached background (Memcached,xcache, etc.) from beginning to end. ) to reduce the pressure on db. In the Content distribution network (CDN) cache, you want your browser to
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