JavaScript get web Page The character set of the form can be obtained by the Acceptcharset method of the form
1 2 3 4 5 6 7 8 9 10 11 12 13-14
Name: Last Name: the value of the Accept-charset is:
The above code
This article introduces the use of JavaScript to achieve a simple map, you can get the map, judge, delete, add, and so on, interested friends can understand the next Code as follows:/* * Map object, realize map function * * Interface: * size ()
There is no block-level scope in the javascript, and instead of JavaScript using function scopes, use the example below to learn how to use JS scopes In some programming languages like C, each piece of code within the curly braces has its own
This article mainly introduces JavaScript to delete the elements of the array method, examples of JavaScript in the use of delete function, with a certain reference value, the need for friends can refer to the
The example in this article describes
This article mainly describes how JavaScript gets the original size of the picture in the width of the example, the need for friends can refer to the
Page of the IMG element, want to get its original size, take the width as an example may be the
This article mainly describes how JavaScript uses bind to designate recipients, and the friends you need can refer to the
The code is as follows:
var json = {
Jarray: [],
Jpush:function (c) {
This.jArray.push (c);
}
}
var examp = ["123", "~",
This article mainly introduces JavaScript advanced skills, the need for friends can refer to the following The last time I sorted out the Ajax part, I finished the Advanced Skill section this week and sorted it out. 1, type detection The use
Let's say there's a checkbox named CheckBox1 on the Web page with a form,form named Form1.
The code is as follows
var f = document.form1;var sum=0;if (f.checkbox1.length) {for (var i=0;i if (f.checkbox1[i].checked==true)
One of the most recent problems in doing a project to the text box in the user input text to be recorded, shown below, because we do is a text messaging platform, now our country's SMS service, if your message exceeds 70 characters, SMS will press
The idea of "quick sort" is simple, and the whole sort process takes only three steps:
(1) in the dataset, find a datum point
(2) Set up two arrays to store the left and right arrays, respectively.
(3) using recursion for the next comparison
to figure out the prototype chain is to understand the function type first, there is no concept of class in JavaScript, is a function, so it is a functional programming language To find out the prototype chain is to understand the function type
in Web front-end development, we often need to judge the data type of a variable. Since ECMAScript is loosely typed, there is a need to have a means to detect the data type of a given variable--typeof is the operator responsible for providing this
This article mainly introduces the use of regular expressions in JavaScript, very detailed, with a simple example, recommended here.
How to use
1. Create an expression
Methods for creating regular expression classes in javascript:
var regex =
This article mainly introduces JavaScript using HTML5 Window.postmessage to implement Cross-domain communication examples, you need friends can refer to the following JavaScript has been a thorny issue because of the limitations of homology
Common types of object creation patterns
Create using the New keywordThe most basic way to create an object is to say the same as most other languages: no object, you new one!
1 2 3 4 5 6
var GF = new Object (); Gf.name = "Tangwei";
JavaScript regular detection contains only Chinese characters, numbers, letters, underscores can not be underlined at the beginning and end, the need for friends can refer to the followingJavaScript regular detection only contains Chinese characters,
Code reuse and its principles
Code reuse, as the name implies, is a part of the code that has been written and even reused to build a new program. When we talk about code reuse, the first thing we can think of is inheritance. The principle of code
This article mainly introduces the JavaScript 21 basic knowledge of the relevant data, the need for friends can refer to the
1.JavaScript case sensitive;
2. Declare a variable if you do not write Var, the global variable is declared; any function
ECMAScript 3 defines some useful functions for manipulating arrays in Array.prototype, which means that these functions are available as methods of any array.1. Array.join () methodThe Array.join () method converts all elements in an array to
Simple example: Determine if there is a child element in the array1 function (str) {2 var tempobj = {}; 3 for (var i=0;ithis. length;i++) {4 tempobj[This [i]] = ' '5 }6 return in
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.