The basic theory Bridging mode definition: separates the abstract part from its implementation so that they can all change independently. The Bridging mode consists of 4 main roles: (1) abstract class (2) expands the abstract class (3)
JS inheritance is used to do what:JS does not really like other object-oriented language as the concept of inheritance, JS inside the said inheritance refers to the simulation of inheritance.Specific JS inheritance is what to do, just start to do
Promise Core DescriptionAlthough promise has its own specifications, but the current various types of promise libraries, in the promise implementation of the details are different, and some of the API even in the sense of a completely distinct. But
SVG can often be used as a cross resolution video. This means that the sharpness of the picture will not be lowered on a high score screen. In addition, you can even get SVG to move by using some JavaScript class libraries. Next, we'll share some
The code is as follows
Copy Code
var myclass= (function (name) {var target={Name:name,Init:function (age) {This.age=age;}};Target.init.prototype=target;target.init.position= ' POSITION ';var myclass=target.init;return MyClass;}) ('
。 Solve 2000 problems
function y2k (number) {return (number
2. Check whether the date is legal
When the input parameter is IsDate (DD,MM,CCYY), it means to check the year, month, day
When the input parameter is IsDate (DD,MM) indicates
This article introduces the JavaScript implementation of the list of linked list insertion and list merge sort, the merge sort of the list is to merge the sort of each part, then merges together.
1. Linked list
1.1 Storage representation of a
2. Prototype mode
Copy Code code as follows:
/**
* Person class: Defines a human, has a property name, and a GetName method
*/
function person () {}
Person.prototype.name = "Jack";
Person.prototype.getName = function () {return
First: JSON mode/object Direct quantity
Format:
var object name = {
Variable 1: The value of the variable 1,
Variable 1: The value of the variable 1,
......,
function 1:function () {
function body
},
function 2:function () {
function body
}//note:
Like http://www.youku.com/v1.0.0326/v/swf/up.swf.
This is a cool video upload selection, it is through the Flash method to achieve the display of non-video class files.
Flash to this effect is generally as described here
Copy Code code as
Regular expression parsing in JavaScriptThe regular expression (regular expression) object contains a regular expression pattern. It has attributes (properties) and methods (methods) that match or replace a particular character (or character set) in
How object literals are exported and what benefits are defined
1. There are two types of output for object literals: traditional '. ', as well as array mode, only when output in an array, the square brackets should be enclosed in quotation marks,
The string type represents a sequence of characters consisting of 0 or more 16-bit Unicode characters, that is, a string. Strings in ECMAScript are immutable, that is, once a string is created, their values cannot be changed. To change the string
To implement dynamic interaction, you must have more sophisticated knowledge about form objects (form) and Frame objects (Frames).
Basic knowledge of formsForm objects enable designers to interact with client users with different elements of a form,
First, prototype chain inheritanceIn the context of prototype chain inheritance, JavaScript is similar to languages such as Java and C #, allowing only a single parent class to inherit. The basic way to prototype inheritance is as follows:
But there is no class concept in JavaScript, the so-called class is also simulated, through the function of the closure to simulate the class members and private members (for closures can see
crossing boundaries: Closures)。 Here we will look at the "
JavaScript has been able to simulate object-oriented encapsulation and inheritance, but unfortunately JavaScript's support for polymorphic features is very weak! Other object-oriented language polymorphism is generally implemented by method overload
Copy Code code as follows:
function Checkmobile () {
var smobile = Document.mobileform.mobile.value
if (!) ( /^1[3|4|5|8][0-9]\d{4,8}$/.test (Smobile))) {
Alert ("Not a full 11-digit cell phone number or the correct number of the top
Sometimes when we are writing JS, we need to trigger events without returning values, so we might need to write this.I've seen several posts on labels and javascript:void (0) Recently, and I'd like to keep them in mind.Note: The following code is
Vue2 scroll bar loads more data implementation code, vue2 scroll bar loads code
Resolution:
To judge the scroll bar to the bottom, three DOM attribute values are required, namely scrollTop, clientHeight, and scrollHeight.
ScrollTop indicates the
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