What is JavaScript?
JavaScript is a scripting language that is widely used in the development of client Web pages (browsers), such as adding dynamic functions to HTML pages, such as responding to users ' various actions. JavaScript is a scripting
Web development often requires cross-domain problems, and the root cause of cross-domain problems is the same homology strategy in browser security, for example, for http://www.a.com/1.html:
The 1.http://www.a.com/2.html are
Problem description
There are some empty string "" when splitting a string using the JavaScript split method, especially when using regular expressions as delimiters.
Related issues
A JavaScript regular expression produces an empty string group
These two days to see the GitHub of a great God, know that he is more interested in the algorithm, looked at one of the algorithm to calculate the number of steps, feeling this is a bit interesting, so I realized one.
Algorithm description and
Before the interview front end, encountered an interview problem, there was no thought so did not answer out, today organized a bit and everyone share under:
The original title is: Use the object method to create a 2x2 table (table), the second row
Question: Write a JavaScript function parsequerystring, which is used to parse the URL parameter into an object.Eg:var obj=parsequerystring (URL);
Create three types of objects:One:
var person=new Object ();
Person.name= "Sun";
person.age=24;
SetTimeout is often used to delay execution of a function:
Copy Code code as follows:
settimeout (function () {
...
}, timeout);
Sometimes the settimeout (function...,0) is used for asynchronous processing, for example:
Digression: Very early contact with JavaScript, but did not pay attention to it, see a lot of cool, very flashy web pages, there are JavaScript, Google in JavaScript application to me the most impact. I'm determined to learn it from scratch, so I
The performance of JavaScript in the browser can be said to be the most important usability problem faced by the front-end developers.
One of the Yslow23 rules for Yahoo is to put JS on the bottom. The reason is that, in fact, most browsers use a
As the title shows, look at the example below.
(You can use the Chrome browser and then f12/or right button to review the elements.) Pull up the developer tool and enter the console console input.(Tips: When the console is entered, Shift+enter can
Before I was in the prototype chain of JavaScript, prototype inheritance and identifier lookup were somewhat confusing,
For example, the following code:
Copy Code code as follows:
function Foo () {};
var foo = new Foo ();
Read a lot of JavaScript strict mode, which has said "Disable with statement", previously seen this is riding on the flowers, around the area, because usually rarely used this statement, the ban can not help to their relationship is not very big.
Usually our website will load some JS code, statistics ah, Google ads Ah, Baidu Alliance Ah, Ali mother Advertising code Ah,A heap, finally make the page loading speed is very slow, very slow.
Solution: Change the way a JS contains, so that the
This tutorial teaches you how to use JavaScript to restrict input to English, or to restrict the entry of Chinese.
No English input:
Copy Code code as follows:
=48&&event.keycode
Only Chinese can be entered with regular
A JavaScript instance that detects form data, very simple, very practical, interested friends can look at
a JavaScript instance per day-detect form data *first field: Second field: &L T;/div> third Field (numeric):
This paper summarizes some JS common functions, including data manipulation, character replacement operation, date and decryption operation function, and some simple validation functions. Convenient for everyone to consult the reference. I believe
The examples in this article summarize the commonly used validation functions for JavaScript. Share to everyone for your reference. The specific summary is as follows:
First, String class validation
1. Length Limit
Copy Code code as follows:
The example in this article describes how JavaScript uses a for-loop batch registration event that does not correctly get indexed values. Share to everyone for your reference. The specific analysis is as follows:
Many friends may encounter a
This example describes the way JavaScript restricts users to only Chinese characters. Share to everyone for your reference. The implementation methods are as follows:
To validate a function we must understand that if it is a Chinese character, 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