However, both methods have their own limitations. alert may interrupt, sometimes the values of alert may be unreliable, and the values of alert may be incorrect when you use the closure. Debugger is actually quite difficult to use, and only supports
Each ()
Each (callback)Execute a function using each matching element as the context. This means that each time the passed function is executed, the this keyword in the function points to a different DOM element (each time it is a different matching
Similar to thinkbox and lightbox. Displays pages, images, or other content in a unique mode dialog box. This is its official website: http://orangoo.com/labs/GreyBox/
Let's take a look at several of its instances:
(1) Open the webpage:
(2) display
You can also know the analysis code.The main reason is that once the file written on the page is loaded, the system requests an image address from the server and loads the large image.If you want to achieve the original effect, the address to be
I. background knowledgeThere are several ways to add events to DOM elements:1. Hard Encoding2. event listening3. Event binding provided by the JS framework1. hardcoded format: the Original Event format.The code is similar to the following:Copy
The selected javascript text is canceled and compatible with all mainstream browsers:Copy codeThe Code is as follows:If (document. selection ){Document. selection. empty ();} Else if (window. getSelection ){Window. getSelection (). removeAllRanges ()
Copy codeThe Code is as follows:// Check whether our number is actually a stringIf (num. constructor = String)// If yes, parse it into numbersNum = parseInt (num );// Check whether our string is actually an arrayIf (str. constructor = Array)// If
Variables in Javascript also support conversion of free types into applicable (or required) content for ease of use.Weak Javascript does not convert the actual variable type to the required data type according to the programmer's desire. For example,
My friends who are doing web development know that debugging js programs is quite depressing, because the language syntax is flexible first, and it is a weak type of scripting language, many errors cannot be controlled. The most painful thing is
Simple codeLet's take a look at a simple piece of code:Copy codeThe Code is as follows:Function HumanCloning (){}HumanCloning. prototype = {Name: 'dummies'}Var clone01 = new HumanCloning ();Alert (clone01.name); // 'dummies'Alert (clone01 instanceof
1 2 3 [Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]Javascript verification is a positive integer Copy codeThe Code is as follows:If (value Alert ("not a positive integer ");} Else {Alert ("
Copy codeThe Code is as follows:Ext. onReady (function (){Ext. QuickTips. init ();// The purpose of the first sentence is to provide the prompt information function for the required components. The main prompt information of form is the error
For example, this call method cannot be used: element. onclick = test (); element. onclick = test (arg1, arg2); only element. onclick = function (){...}; or element. onclick = test. Therefore, parameters cannot be passed to the function. Based on a
javascript to obtain the radio selected value 1 2 3 4 5 [Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]Js select radioDocument. consumerform. consumer_sex [0]. checked = true;Below are
Use javascript to move the div layer-javascript drag layer:Program function: Use javascript development to drag the div layer in the following html code at Will on the interface.Javascript mobile div layer-javascript drag Layer Code-Html code:Copy
However, from the perspective of debugging, the functions of these debuggers are sufficient. In fact, what I need is not a JavaScript IDE, but a JavaScript refactoring tool. This allows me to quickly refactor JavaScript components, it is much more
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