There is a classic book called design patterns, which talks about 21 classic design patterns. We suggest you take a look.
1. Single responsibility
For a class, there should be only one reason for its change.If a class has too many responsibilities,
Jqueyr determines the sample code of the checkbox group. For more information, see html:
The Code is as follows:
Approval Not Approved
Jquery:
The Code is as follows:
$ (Function (){$ (". CheckboxListItem"). change (// instructorFunction (
There are many ways to submit Form forms. This article describes how Jquery submits Form forms through Ajax. Today, we can see Jquery's ajax method to submit data to the server. The original Article is:
Save the data to the server. If the data is
This article provides a detailed analysis of the getParent method for obtaining the parent window link in js and various window opening methods. For more information, see
The Code is as follows:
// Open the modal windowFunction dialog (obj ){If
By default, getJson uses browser cache in IE, so the data is not displayed, so it can be solved without caching.
The Code is as follows:
$. AjaxSetup ({cache: false });$. GetJSON ("/MyQueryUrl", function (data, item ){// Do stuff with callback
A small example of setting the IFrame height automatically in JavaScript. For more information, see
The Code is as follows:
Function SetIFrameHeight (down ){Var Sys = {};Var ua = navigator. userAgent. toLowerCase ();Var s;(S = ua. match (/msie ([\
When you move the mouse over an image, follow the mouse to show the enlarged image. The specific effect is provided with the source code. If you are interested, you can learn the original status:
Mouse:
The Code is as follows:
Untitled
Window. event. keyCode is compatible with the specific implementation code of IE and Firefox as follows. If you are interested, refer to the following HTML code.
The Code is as follows:
Javascript code
The Code is as follows:
Function
We will share with you the following two ways to set the disabled attribute and three ways to remove the disabled attribute. If you are interested, refer to the following for help.
The Code is as follows:
// Set the disabled attribute in two
Determine whether you want to disable the global control or specify the control. If it is global, you only need to listen to the window. keyDownfunction (event ){.....} the same is true. If you are interested, you can check whether you want to
Javascrip: a small example of inheritance. For more information, see
The Code is as follows:
// InheritFunction Person (name, sex){This. name = name;This. sex = sex;}Person. prototype. sayName = function (){Alert (this. name );}Person.
We know that JavaScript is an object-oriented scripting language, so since it is object-oriented, inheritance must be indispensable. The core of JavaScript is ECMAScript. The implementation of the JavaScript Inheritance Mechanism is actually the
This morning, I was very depressed. I was confused by many simple issues. At present, COO is not a good choice. You still need to remember the code!
The Code is as follows:
Several implementation methods of startWith and endWith in javascript. If you need them, refer to JavaScript to implement startWith and endWith functions using regular expressions.
The Code is as follows:
String. prototype. startWith = function
It is not difficult for jQuery to operate on listbox. It is to move the selected items in listbox to achieve the desired moving effect. The following is an example, if you are interested, it is not difficult to learn how jQuery operates listbox. It
Use window. location. when the reload () method is used to refresh the page, the IE pop-up "to display the page again .... "dialog box, solution. Next, we will introduce the detailed solution. If you are interested, refer to the window. location.
This article introduces the support for ExtJS4.1 shortcut keys. If you need a friend, refer to the following question. One page has two panels and each has a [add (F2)] button. How do you support shortcut keys? Image Diagram
First implementationIt
When the mouse clicks in the search box, the text in the box disappears, and the focus and focus loss events in the search box are often used. Next, we will introduce the specific code, for more information about the amount of friends you are
Js operation cookies include: Writing cookies, reading cookies, deleting cookies, and using examples. If you are interested, refer
The Code is as follows:
// JS cookies operation method!// Write cookiesFunction setCookie (name, value){Var Days = 3
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