Author Mark ' Tarquin ' wilton-jones • November 2, 2006
This article translates from efficient JavaScript
The address of the original translation http://kb.operachina.com/node/207
Traditionally, web pages don't have a large number of scripts,
constructor is a special way to initialize a newly created object when memory has been allocated to the object. The object constructor is used to create objects of a particular type – ready objects for use, and the colleague receive constructor can
There are many examples of how JavaScript can realize digital clock effect on the Internet, but this article introduces the digital clock of scrolling effect. Small series think the effect is very dazzle, share below to everybody.
Let's take a look
1 Introduction to the use of the Eval function in JavaScript
(2) How to execute global code within a function
► First, the use of eval, the content is relatively simple, familiar can skip.
The Eval function receives an argument s, and if S is not a
Today's JavaScript is no longer a fancy script that has been used as a toy to run on a Web page. JavaScript has become more standardized and widely used as a real programming language for Web development. As a result, more and more people are
We know that the innerHTML attribute with the browser itself can get the value of the string contained in the node, such as the following nodes:
Copy Code code as follows:
i ' m strong
Pass
Copy Code code as follows:
If you want to learn more about EV
For Al and JSON, refer to the following links:
EVal:https://developer.mozilla.org/En/Core_JavaScript_1.5_Reference/Global_Functions/Ev Al
JSON:http://www.json.org/
Howthe Ev al function works TheEv al function
Foreign like based on jquery Requirejs,yui Loader,labjs,runjs, the domestic also has the seajs of Taobao, watercress Dojs, these are some very good module loader. But this article will introduce you to a new open source lightweight "multi-threaded"
DateAdd function:
Copy Code code as follows:
function DateAdd (interval,number,date) {
Switch (Interval.tolowercase ()) {
Case "Y": Return new Date (Date.setfullyear (Date.getfullyear () +number));
Case "M": Return new Date
The array of Javascript arrays, both an array and a dictionary (Dictionary). Let's take a look at the use of arrays.
Copy Code code as follows:
var a = new Array ();
A[0] = "Acer";
A[1] = "Dell";
for (var i = 0; i Alert (A[i]);
At present, the commonly used browser ie, Chrome, Firefox have the corresponding script debugging function. As our. NET camp, learn how to debug JS in IE is enough, in the grasp of IE debugging methods, Chrome and Firefox debugging methods have
The textarea element has been widely used in the Web-page IDE. Usually the site's own textarea editor does not meet our needs, as a developer we often need to do code online editing, highlighting code, etc., so, through other open source projects,
In the morning to see the "JavaScript Weekly Guide" "Phase III" of the article, which found an article (extending javascript–the right Way), feel good, translated to share with you, this article is not a word for translation, as far as possible to
The first two only difference is that the loop and the order of the judgments are different, do-while than while more than one cycle, I do not give an example.For loop I believe that we can not be ripe, we will see for-in this sentence.This is
The Replace function accepts two arguments, the first argument is a string or regular expression, and the first argument can also accept a string, or possibly a function.
First, we no longer need to say "I am a Boy" for the first parameter as a
In contrast to the in operator, for-in loops through the prototype chain when iterating over the object's properties, for-in does not read an enumerable property, such as the length property of the group. Summary when you detect whether an object
We know that the instanceof operator is used to check whether an object is an instance of a constructor. The following lists the various scenarios in which it returns true.
1. Object obj was created through new constructor, then obj Instanceof
Copy Code code as follows:
Say the red above the insert into the Web page you can achieve the right mouse click is not valid
Onselectstart= "return false" prohibits selection, ondragstart= "return false" to prohibit drag and drop,
The JavaScript described here refers to the hosting environment in the browser environment. The first is ECMAScript global object, and the second is global objects/functions under the Host Environment (host).
One, core JavaScript built-in object,
JS in different types of basic data can be converted between, this conversion is a rule can be found, not arbitrary random. There are 5 basic types of data in JS: String, number, Boolean, null, undefined, where the type commonly used for calculation
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.