The method in this object is to provide some tool methods for string operations, the more important gsub method, the detailed annotations below, the simple method will not be mentioned, you can see it at a glance.
The Code is as follows:
// Static
Implement function code for loading JS files asynchronously.
The Code is as follows:
ScriptFunction getJsFile (url, callBack ){Var XH = window. XMLHttpRequest? New XMLHttpRequest: new ActiveXObject ('msxml2. xmlhttp ');XH. open ('get', url,
This object provides some tool functions that operate on numeric types.
The Code is as follows:
Object. extend (Number. prototype, (function (){// Returns the hexadecimal color.Function toColorPart (){Return this. toPaddedString (2, 16 );}//
Some basic methods of dom are essential knowledge for operating html tags. Only by mastering these foundations can we achieve better results. Direct reference node
1.doc ument. getElementById (id );
-- Find the node through id in the document
2.doc
Js achieves seamless rolling and compatible with IEFF. You can take a look. Principle Analysis:
1. First, set the height or width for the container, such as ul, and set ul height to 40px; overflow: hidden;
2. After the height of the container is set,
Dynamic addition of list box items, good results, need to use friends can refer to the next.
* select 1-3 knowledge points. 1213123123 2123123123 3213123213 4123213213 5213123213 6213123213 "/> var addTo = document.
When a client user switches the Input Method to the fullwidth mode, your form submission may be vulnerable! But in fact, js has this function to convert it to non-fullwidth characters! Let's take a look at this example!
The Code is as follows:
In chapter 1, we use constructors and prototypes to implement classes and inheritance in the JavaScript world, but there are many problems. In this chapter, we will analyze these problems one by one and provide solutions. Note: The implementation of
Prototype Learning Tool Function Learning ($ A usage) $ A method:
Accepts an array-like collection (anything with numeric indices) and returns its equivalent as an actual Array object. this method is a convenience alias of Array. from, but is the
This is not a concept. Because the namespace in C # Won't follow the method directly, it must be an object and then calling the method, however, it is similar to the namespace in C ++ that Object is used by Prototype as a namespace; that is, it just
$ Method-becomes Swiss Army Knife $ method tips. $
$
$
$ F
$ H
$ R
$ W
Try. these
Document. getElementsByClassName
$ Method -- become a Swiss Army knife (Swiss Army knife)
If provided with a string, returns the element in the document with matching
This chapter focuses on several important attributes (this, constructor, prototype) in JavaScript. These attributes play a vital role in understanding how to implement classes and inheritance in JavaScript. This
This indicates the current object. If
Detailed description of javascriptdom operations js Enhanced Operation implementation code. 1. Each node in the document has the attributes nodeName, nodeValue, and nodeType.
The node name of the nodeName text node is # text, and nodeName is a
Sometimes we want to dynamically load the css file when designing a webpage, instead of writing the css file to the page, we can use the following method.
1. load required files in external CSS files@ Importurl(style.css );
// It can only be used in
This object contains a toJSON method, which is very simple to look at the source code:
The Code is as follows:
Date. prototype. toJSON = function (){Return '"' + this. getUTCFullYear () + '-' +(This. getUTCMonth () + 1). toPaddedString (2) + '-
Do you remember the refresh function in the meta tag? This allows you to refresh the browsing page and go to the corresponding page. If you refresh this page, it will cause repeated refresh. Now we will try to use the script to refresh the page only
In the client browser, you can use javascript to block the entire page by using a div as the mask layer at a certain time. The specific solution is as follows:
1. The clientHeight, offsetHeight, and scrollHeight attributes of the document. body
You can obtain the content in td in htmltable. Very good.
function numberCells () {var count = 0; for (I = 0; I 1 2 3 > 4 5 6 7 8 9 10 11 12 [Ctrl + A select all Note: If you need to introduce external Js, You need
A lot of Sina's Advertising Code has been widely spread by the majority of webmasters. If you have time to look at it, their code is all written class, a lot of good things. Today, I checked Sina's js Code and found a back-cast Advertising Code,
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