I saw a piece of code today, which is interesting. I will ask more this week. See the following code:
The Code is as follows:
Var a = function (t) {return t ;}(1 + 2). toString ();Alert ();
What is the result?
In fact, the main problem is
On QQ's online video website a few days ago, the image on the video list page above has the following effect: the image is loaded only when the scroll bar is pulled down, that is to say, it will not load all the images at once. It will be displayed
This article is translated from LazyLoadPluginforjQuery and introduces a jQuery plug-in that provides the function of loading page images in a lazy way.
How to use it?
Lazy Load depends on jQuery. Add the following code to the head area of the page:
For more information about jQuery event models, see. Functions of the jQuery event model include:
Provides a unified method for establishing event handlers;
Multiple handlers can be created for each time type on each element;
Use a standard event
I used to test my website in IE8. Some of the Code that was written later failed and I had to download Firefox and its plug-in Firebug to find that FF does not support windows. event. So I changed my mind. HTML
The Code is as follows:
In jQuery, you can modify the keyboard event and pass in the event when calling the function. The which of the event can be used to find the key code.
However, when there is a combination of keys, you need to pay attention to it.
For example, the
After clicking, you can enter the number of the sorted numbers. The database is automatically updated after removal. Ultimate goal: to facilitate sorting.
Specific implementation: After clicking the button, you can enter the number of the sorted
In the past, I turned to an article about the wonderful use of | and & amp; in JavaScript. Below are some optimization methods. The first piece of code emphasizes this usage. I used a switch in my project. Later I found this code ugly, so I wrote it
The event object contains three pieces of information & #183; & #183; & #183; & #183; & #; read back the previous article! The attributes and methods in the event object are mainly the mouse and keyboard information. Review
The event object contains
During development, we often need to determine whether an object is of the array type. In Js, what common methods are used to detect the object type? 1. typeof operator. For Function, String, Number, Undefined, and other types of objects, it is
If the webpage is not opened through a script program (window. open (), call window. before closing the window, you must close the window. the opener object is set to null. Otherwise, the browser (IE7 and IE8) will pop up a confirmation and close
The circular queue Code implemented by using arrays in javascript can be referenced by friends who need it. // Cyclic queue
Function CircleQueue (size ){
This. initQueue (size );
}
CircleQueue. prototype = {
// Initialize the queue
InitQueue:
In fact, at this time the year before, I used this sortable component. At that time, I made a personal website (unfortunately it was closed later), and the homepage used this drag-and-drop effect. At that time, I copied a few words from jquery's
The following code can detect the message that the user is about to leave, whether the user clicks close, or closes in the taskbar, click back, refresh, or press F5. The cause of the event is that, due to customer feedback at work, users often order
The RegExp-type RegExp object constructor can include one or two parameters. The first parameter is the pattern string to be matched. If there is a second parameter, this parameter provides additional processing instructions. RegExp class
The RegExp
All those who have done front-end settings know that css has two types of box models, W3C standard box models and IE browser box models. Most browsers except IE only support the W3C box model. The IE browser can use the right box mode according to
The visibility attribute is used to determine whether an element is displayed or hidden. This attribute is expressed by visibility & quot; visible | hidden & quot; (visibility indicates display, and hidden indicates hidden ). When visibility is set
Let's get an instance, use Dom knowledge, and perform instance operations. Dom basics-create a table
Using js to dynamically create a table can be in two formats: appendChild (), insertRow, and insertCell (). However, the first type may have
Preventing repeated submission of forms in websites is a common requirement. There are also many methods to achieve this first. My solution is as follows (only for the client ):
Click the submit button to add the disabled attribute to the button.
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