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
First of all, the difference between null and undefined:
Performs typeof on declared but uninitialized and undeclared variables, and returns "undefined".
Null represents an empty object pointer, and the typeof operation returns "Object".
It is
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
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;
Peter Seibel, author of Practical Common Lisp, once said that if you need a pattern, there must be something wrong. The problem he said is that because of the innate defects of language, it is necessary to seek and summarize a common solution.
JavaScript does not have a mouse object, and getting the mouse coordinates depends on the powerful event object.
By listening to the MouseMove of the document, we can get the mouse position in real time.
But!! Event and mouse-related properties
This example summarizes the common how-to techniques for javascript arrays. Share to everyone for your reference. Specifically as follows:
Objective
I believe that we are used to jquery or underscore and other such libraries commonly used in the
Observer mode (also known as publisher-Subscriber mode) should be one of the most common patterns. are used in a lot of languages. Including the DOM events we normally touch. It is also an observer pattern implemented between JS and Dom.
The most basic function of JavaScript in a Web page is to listen to or respond to a user's actions, which is very useful. The user's action some very high frequency, some very rare. Some listener functions execute like lightning, and some heavy drag
Lokijs is a memory database that puts performance considerations in the first place.Lokijs supports indexing and faster document access, performing very well (nearly 500,000 ops/seconds). Its built-in Dynamicview classes can be used for indexing of
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:
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
Copy Code code as follows:
Copy Code code as follows:
Url:
PHP detects URL address validity
The code is as follows
Copy Code code as follows:
?
function Is_url ($STR) {
Return Preg_match
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.
Detects whether the current window is closed before the current window closes
In IE9, if the document is refreshed, Unloadform and onbeforeunload will execute, and if the page is closed, only the onbeforeunload event will be executed
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 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