JavaScript FontColor Method
The FontColor method returns a colored string that is defined using the Color property in the HTML font label. The syntax is as follows:
Copy Code code as follows:
Str_object.fontcolor (color)
JavaScript LastIndexOf method
The LastIndexOf method computes the last occurrence of the specified string in the entire string and returns the value. The syntax is as follows:
Copy Code code as follows:
Str_object.lastindexof
JavaScript onkeypress Events
The onkeypress event is triggered when the user presses or holds a keyboard key.
Note: onkeypress Events and onkeydown events are slightly different, onkeypress events do not do the corresponding function key pressed
In some DOM operations we often deal with the location of elements, mouse interactive a frequently used aspect, it is disappointing that different browsers will have different results or even some browsers have no results, this article on the mouse
This chapter is not esoteric to explain some of the underlying principles of JS, such as this pointer, scope, prototype, are involved in some of the normal development of the code to simplify, improve the efficiency of execution, or can be used as
Today I answered a question about Javascript, which involves assigning problems, so I want to make a good summary of this problem.
Copy Code code as follows:
var a = ' test ';
var B = function () {};
B.A = ' Test ';
function
One of the most important features of Javascript is the use of closures. Because of closures, the current scope always has access to external scopes. Because Javascript does not have block-level scopes and only function scopes, the use of closures
One, this point to the constructor instantiation object
In the previous article, we mentioned the difference between using new and calling constructors without using new, as in the following example:
Copy Code code as follows:
Concept
From Wikipedia: According to CSS1, which was published in 1996 by the World Wide Web Consortium and revised in 1999, when any block-level element's width or height is explicitly specified, it should only determine the width or height of the
Event object: (an Event object is a property of a Window object that, when an event occurs, produces an event object, the event ends, and an event object disappears)
In IE: window.event;//get objects
DOM: argument[0];//fetching objects
The
The first rule of the Golden rule:
JS does not have block-level scopes (you can do it yourself closures or other methods), only function-level scope, functions outside the variable function can be found inside the function of the variables outside
Switch statements are most closely related to if statements, and are commonly used in other programming languages as a flow control statement, but switch matching is congruent mode, if you do not pay attention to the details of the program will
This is actually a practice for JS random numbers, first put all the names in an array, and then let the values in the array quickly displayed in the area, when you press the Stop scrolling will stop to achieve the random effect.
js
Queues are an ordered set of advanced First Out (FIFO) principlesThe queue adds a new element to the tail, removing the element from the top
The understanding of the queue
The most common scene in our lives is the queue.The name of the queue is
Some time ago need to get the source of the page through JavaScript, this operation is very simple, using document.referrer can be obtained. However, there are still a lot of surprises in the application, and here is a simple arrangement.
The first
two demo code as follows (for IE only):
//demo3 (for Firefox)
selectSingleNode SelectNodes method to enable Firefox to process XML (IE)
var Isie =!! document.all;
function Parsexml (ST) {
if (Isie) {
var result = new ActiveXObject
This
This represents the current object that refers to the current Page Object window if it is used globally, and if this is used in a function, this refers to what is invoked on the object based on this function at run time. We can also use apply
Personal the most
Memtronic ' s freeware html/javascript cruncher-compressor v1.0k
The compression effect is not generally good, the confusing code is completely unreadable, the compression rate can be up to 50%,ie 5+/NS 7.0/mozilla/opera 7.0 can be
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.