Programmers who are familiar with web development must not be unfamiliar with Ajax. Now there are many JS frameworks that encapsulate Ajax implementations, such as JQuery's Ajax functions, which are very handy to call. Of course this article does
Learning points:1. Use the Validate.js plugin2. Default validation rules3.validate () Methods and options4.validate.js Other Features
Verification Plug-in (Validate.js) is a plug-in that verifies the legality of regular form data. Use it, greatly
It's strictly a custom pseudo-class selector, but it's also pretty interesting.Yesterday when I learned one of the jquery lazy load source, I saw it written at the end. /* Custom selectors for your convenience. Provide a custom choice for your
Method one, using the remainder operator to judge
Any integer will be divisible by 1, that is, the remainder is 0. Use this rule to determine whether an integer.
function Isinteger (obj) {return obj%1 = = 0}Isinteger (3)//TrueIsinteger
As Web sites become "Internet apps," JavaScript code embedded in Web pages is growing larger and more complex.
Web pages are more and more like desktop programs, need a team division of work, progress management, unit testing and so on ...
Today we'll explain how to use them in combat.
I'm using a very popular library require.js.
One, why should use Require.js?
At the earliest, all of the JavaScript code was written in a file, and it was enough to load the file. Later, more and
Cookies and sessions are commonly used to implement the Http state of the technology, in the continuous use of their own understanding of it. My next discussion is based on the following sequence:
1. Why to use cookies and session
Because the
Brief summary: Apply (): Call the function as a method of the specified object, passed to it is the specified argument array--function.apply (thisobj, args) or function.apply (thisobj, args) Bind (): main function: Bind a function to an object,
JS full selection function code optimization Recently looking at JavaScript MVC that book, also feel that their own writing code is not elegant, so have been thinking of another mode to write JS code, so for the previous simple JS full selection
only objects in the 1.js, including objects, functions, constants, and so on.
Object without explanation. Functions also have properties, one of the common is prototype. Constants also have attributes:
(3). __proto__;//number {}
2. Prototype of
In the basics of JavaScript programming, arrays are what we most often encounter, and some of the common methods of arrays are what we have to master, and here we summarize the methods commonly used in arrays .
ToString () and valueof () methods
Event delegation, also called an event delegate. is a common technique for binding events commonly used in JavaScript. As the name implies, "event Agent" is to delegate the original need to bind the event to the parent element, so that the parent
The UI thread blocking problem caused by synchronous Ajax was encountered and recorded here.
The reason is this, because there are several similar asynchronous request actions on the page, in line with the principle of increasing the reusability of
Pop-up layer of the application or more, landing, some of the same page operation, others are always others, their own is their own, so has been wanted to write a pop-up layer plug-ins. No more nonsense, just start it! Do not want to see here can
For example, the ie10-version is in accordance with the general only support attachevent and not support AddEventListener, but to IE11, but in turn only support AddEventListener and not support attachevent. This alone can tell IE is a big hole, the
Page of the IMG element, want to get its original size, take the width as an example may be the first thought is width, as follows The Getwh method used here is mentioned in the previous article. The width you get is the same as the original size
As a front-end developer in the Web display often encounter, the title is too long, need to intercept the string, with the implementation of CSS various compatibility problems, various pits. Let the background program, and a variety of Dodge, let
Advantages of the jquery paging effect
var total=$ (. Class). length; Gets the total number of elements that need to be paginated var radio=3;//according to the width screen to obtain the number of offer per page display: var pagesize=parseint
First, the preface
When too many pictures are requested in a page, and the picture is too large, the speed of the page access is very slow, the user experience is very unfriendly; use the picture lazy load, you can reduce the pressure on the server,
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.