Before reading this blog post, please read "Understanding the Javascript_13 _ execution model details" and explain the issue about scope allocation in the execution model details, this blog post will detail the relationship between function objects,
On web pages, we often need to modify styles to provide a better user experience. For more information, see. For example, when we move the mouse over an icon, the icon will have some animation effects (gradient amplification, flashing, changing
I don't want to talk about anything. I want to explain everything in two diagrams with a piece of code. Note: before that, read the previous series of blog object models.
The red dotted line indicates the implicit Prototype chain.
This object model
Jquery determines the number of characters input (numbers are counted as 1 in English, Chinese as 2, and are automatically truncated beyond the length) 1. $ ('textarea # txtPrizeNote '); // indicates the name of the textarea Control
2. The 'span
In JavaScript, you can use instanceof to determine whether an object is an instance of a class or its subclass. For example:
The Code is as follows:
// Code 1Function Pig (){}Var pig = new Pig ();Alert (pig instanceof Pig); // => trueFunction
Upgrade JQuery1.2.6 to JQuery1.4. After several days of work, the ajax polling page was not closed. The next morning, the memory ran out and it was found that this memory leak did not exist on IE6 (IE7 was not tested ), JQuery1.3.2 and JQuery1.4 +
After an ajax request is executed, we usually need to update some content on the interface by dynamically inserting dom elements. However, if the changes are large, the amount of code is large.
In this case, you can use the jquery load method to
It turns out that IE and Firefox have different levels of support for bubble events. (For example, if you are not familiar with the bubble event, you can first query the relevant information.) Suppose there is a tag on our page:
The Code is as
Obtain the function of the element set based on the element clsssName. For more information, see. Let's take a look at the Code: (Multiple class queries and queries within a certain range are supported)
The Code is as follows:
/** Obtain the
I haven't written JavaScript code for a long time, or I haven't written any articles for a long time. In the afternoon, I wrote a jQuery-based form verification plug-in. I declare that this plug-in has many problems, but I think it is necessary.
The javascript code is used to calculate the remaining length of the text field. This Code is also a simple implementation method.
Remaining words in the text field calculated by JS function displaySpareNumber (_ this, size) {var spareNumber =
The code of the hamster game is described. If you prefer to develop a game using js, you can refer to it. Demo address: http://demo.jb51.net/js/mouse/index.html
Packaging http://www.jb51.net/jiaoben/32434.html
This was written when I was bored.
Without getting tired of the original alert style, it is always an exclamation point. Sometimes the UE is poor. Today we will introduce the JqueryAlert plug-in, which can be used to replace alert, confirm, and prompt in JScript. Download the JS file
In fact, the original ECMAScript types include Undefined and Null. Both types correspond to their own unique private values, namely, undefined and null. A general answer:
In fact, the original ECMAScript types include Undefined and Null. Both types
There are also many plug-ins in the JQuery pop-up window, such as Lightbox... We will introduce the excellent Plugin-Fancybox. Main features:
Display HTML, swf, Iframe, and ajax requests
Allows you to scroll over an image.
Supports shadow and zoom
After the data is retrieved, it can be transmitted to the front-end for processing in json format or XmlDom format. The following example uses Jquery to process XMLDom. Steps:
1. Reference Jquery
2. for IE, the instance ActiveXObject; Firefox, And
I recently spent some time writing a plug-in for the pop-up layer, which is not very powerful. When practicing, the following is the sample code.
The Code is as follows:
When JQueryUI's DatePicker is used, it is found that if the page has another control with a relatively large z-index, datepicker will be overwritten and cannot be operated. I have not found an effective solution on the Internet. Here is a seemingly
Jquery selector, a commonly used selector description, learning jquery friends must learn and understand the knowledge.
Basic selector:
$ ("# MyELement") Select the element whose id value is equal to myElement. The id value cannot be repeated. Only
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