Prototype and [[prototype]On the premise of having a face object, let's look at a piece of code:Copy codeThe Code is as follows:// Animal ConstructorFunction Animal (name ){This. name = name;}// Animal prototype objectAnimal. prototype = {Id:
For example, use _ $ (id) instead of document. getElementById (id ).If it is a pure replacement, you can use the following codeCopy codeThe Code is as follows:Function $ (id) {document. getElementById (id )} For personal comparison, we recommend
Test code:Copy codeThe Code is as follows: jQuery Css Test test
The pop-up box displays information:
IE8:
IE7:
IE6:
Firefox:
Chrome:
Opera:
The following are all the same and return the String type.
Complete DEMO code: JQuery achieves image carousel effect [demo] 1 2 3 4 [Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute][Principles]Here we will talk about the entire process:
Css code:Copy codeThe Code is as follows:. X-grid-back-red {Background: # FF0000;} Js Code:Copy codeThe Code is as follows:{Header: 'split into type ',DataIndex: 'dividetype ',Renderer: function (v, m ){M.css = 'x-grid-back-red ';Return v;},Width: 60
Ff cannot be accessed directly by the Frame ID.(Ie ff can be accessed directly through the Frame Name, But FrameSet does not support the name attribute)Therefore, window. parent. full elementbyid ("full ");For details about js operation frame, the
Finally, with the help of the great Baidu, I found the cause of the problem:Copy codeThe Code is as follows:$ ("") Is a jquery object, not a dom elementValue is the attribute of dom element.Jquery corresponds to val.Val (): obtains the current value
Because we always use process-oriented programming ideas to write JS Code, and because the network is filled with too many small "clever" JS code segments, many of them are casual and very nonstandard, this leads to a "misunderstanding" of JS,
After several twists and turns, I finally got it, as shown below:Specific implementation:(1) Compile jquery. divbox. js code:Copy codeThe Code is as follows:JQuery. fn. extend ({OpenDiv: function (){Var sWidth, sHeight;SWidth = window. screen.
This document describes the current window or the specified window object. It contains the content of the document from to .Usage: document (current window) or . document (specified window)Attribute:Document. title // set the document title is
The immediate result is:The browser will immediately execute the file after the content is stable, which achieves the same effect as or .It should be seen that this function is better than the above method. The first two functions can only be
Function:Flash calls some methods to view the data output by the flash trace method on the webpage;Method:1. init (w, h, z); // w indicates the width of the display interface, h indicates the height of the display interface, and z indicates the
This is an important concept in object-oriented language. In large languages such as JAVA and C #, this is fixed to the current object at runtime. However, in javascript, due to the dynamic nature of javascript (interpretation and execution, there
Advantage: You can also click the body area to hide the drop-down menu and it does not conflict with the existing onclick event of the body.Disadvantages: Please point it out and accept it modestly!The code in the running box seems numerous and
In fact, obtaining the mouse position is just one sentence, but if you don't know the difference between browsers, the whole process will be depressing. The difference is as follows:1. for IE, the distance between x and y axes is obtained using
Method 1: setAttributeVar obj = document. getElementById ("obj ");Obj. setAttribute ("onclick", "javascript: alert ('test ');");Here, setAttribute is used to specify the onclick attribute, which is simple and easy to understand,However, IE does not
All constructors are objects, and not all objects are constructors. Each constructor has a Prototype attribute used to implement Prototype inheritance and share attributes. An object is created using A new expression. For example, A new String ("A
If you do not understand the reason, do not worry. go deep into the CSS rules and read the Using CSS to Fix Anything: 20 + Common Bugs and Fixes article.
If the previous article does not help you, you can use one of the following 12 javascript
Software 1 1.gif Control 2 2.gifThis is one of the most common examples on the Internet. I also want to write the main code.Var Info = Ext. data. Record. create (['Name', 'icon'']);Reader = new Ext. data. XmlReader ({Record: 'soft ',Id: 'name'},
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.