> Well, this topic has been around for a long time and should be changed. You can find out if there are any topics that suit your appetite.> In other words, I recently went a little bit towards PHP. I found that I was greedy and chewy, so I went
This feature obviously helps you to be lazy, and of course also helps to implement some specific functions. To illustrate this feature, we will start with a real development case.In your WEB project, you need to output a list HTML like the following
Source DocumentTemplate document (JavaScript code is reduced here and the code is placed in the CDATA segment)
Source Document
Template document (JavaScript code is reduced here and the code is placed in the
Demo1 is the simplest implementation. The page id configuration needs to be written in the js file, which is suitable for simple scenarios.Dynamic configuration is added for demo2, which can be passed in. It is suitable for multiple cascading
Copy codeThe Code is as follows: 1 1.1 This shows two categories. Click the parent-Level Display (hidden) sub-level menu, and the JS Code will be in the same sentence:Copy codeThe Code is as follows:Function news_pro (o){Var obj = document.
1: Modify the execution method of the loopFor (var I = 0; I Execute Code}In this way, the value of element. childNodes. length must be setVar n = element. childNodes. lengthFor (var I = 0; I Execute Code}2: Number of dom modification operationsDom
. (New users may think that setTimeout and setInterval are javascript Functions, which is incorrect. Beginners can easily confuse javascript Object functions with DOM object methods .)Let's start with a piece of code. Let's guess what the results
JQuery 1.4 source code line 449 (line 431 of core. js), The method for determining whether it is a function is as follows (The idea comes from The Miller Device of Douglas Crockford):
isFunction: function( obj ) { return toString.call(obj) ===
Fortunately, everything is available on the Internet. I found a function with the Best Browser compatibility. After testing, it is compatible with IE, FireFox, and Chrome, and there will be no problems with scroll bar errors. archive the function
Js parsefloat parseintJavaScript provides three explicit type conversion functions: eval (), parseInt (), and parseFloat ().Eval () function: converts a string expression to a numeric value. For example, the result of the statement total = eval ("432
The Code is as follows:Copy codeThe Code is as follows: But we cannot reuse this object. How do we use this object as a prototype?First of all, it is impossible to have a constructor in a json object. Let's make a simple "Factory" and write a method
I encountered this kind of thing in an article I wrote some time ago. Later, I used the overflow and max-width attributes of CSS to solve the page deformation problem temporarily. The advantage of this method is that it is simple, but the
The objects in javascript have not yet explained what is going on. When it comes up, we will go straight to the topic, class/Inheritance/prototype/private variable ....As a result, after reading it for a long time, I had a rough understanding and
In form, the submit shortcut is enter, and the reset shortcut is esc. However, in IE6, safari4, ff3.5, opera10, and chrome, pressing Enter not only triggers the form submit event, but also triggers the onclick of the submit button, the excitation
The company's WEB project must be compatible with FF3, IE6/7/8. This article describes a BUG in IE6.A self-encapsulated pop-up layer is written in the project. The principle is to dynamically Add a mask layer, and then dynamically Add a DIV (Table)
The author sends a picture, which can be enlarged.The Literal Syntax problem about JavaScript was mentioned a few days ago and it was quite interesting. So I studied it again. Can I convert the object into the Literal form? Just like what we usually
CSS adds a shadow to an image move to show smooth shadow [Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]
Copy codeThe Code is as follows: Note the following two points for the above method: 1. Get the smallest unit of obj in findAll; otherwise, the replacement will be messy. In practice, I have learned that this is mainly related to data island binding,
select an address similar to the 51job effect select the cities you have selected [cancel] [OK] layer 0th layer 1st layer 2nd Layer 3 Beijing Fujian Sichuan Jiangsu Shanghai Yunnan Guizhou Heilongjiang Jilin Liaoning USA
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.