Screen Object
Get the width (resolution) of the screen
Screen.width //Screen wide
screen.height//Screen high screen.availwidth//Screen available width The pixel height of the screen minus the value of the system part
Recently a period of time to see a lot of JavaScript library source code, such as prototype, EXT core and so on. This concept is applied extensively in these libraries. It was not until yesterday that the book "The Return of the JavaScript king" was
When the first entry from the main window into an iframe abbreviation {a}, at this time the data presented in this {a} is new, and then I point to another iframe abbreviation {b}, here {b} data is also new, in {B} in some logical processing, such as
Search the code on the Web, make some changes to that,
Fix can't customize color, fix IE8 error, and other minor bugs compatible with Ie6~8 and Firefox
You can customize
Tip Window Caption Height
The border color of the prompt window
The caption
1. Create a base class
First consider the Polygon class. What properties and methods are required? First, be sure to know the number of edges of the polygon, so you should add the integer attribute sides. What else is required for polygons? Perhaps
There is no strict pause and restart for JavaScript timers, only cleanup stops, but can be implemented with some ' cloaking '
Allchild[index].onclick = function () {///Let the timer pause if (Gamint = True) {$ ("#tu" when clicking on the
JavaScript in the application process will encounter a variety of comparisons, today to all of you to organize three kinds of situation, together to learn.
1. Comparison of two objects
JavaScript comparisons are mixed with some of the more bizarre
Call Portal
A chained invocation has two entrances to the Async.go method and the Async.chain method, which are essentially consistent, except that the Async.chain method does not provide the initial parameters when invoked, and the Async.go method
When I first saw this dongdong, I thought it was the normal parameter of "disguise", but I didn't have to declare it clearly when I was defining the function.
However, the code is cheap (the code is cheap.) Looking at the codes:
function Functest (A,
var x = "XX";
y = "xxx";
Such. There's a problem here, for example, in a line in the code, I would like to use a declared variable x, the result of typing or spelling errors, the variable is written y, the result is equivalent to "implicit" declared
Recently encountered JS efficiency problem, is about the new elements in the page problem.
Suppose we have the following page:
Copy Code code as follows:
Now that we're going to add objects to DIV1, we
This effect itself is not very difficult, mainly in the program structure and expansion of some kung Fu, in order to use more convenient, can be used in more places.
Program features
1, the same hint box used in multiple trigger elements, only one
3, scope
All object-oriented languages have some form of scope, and JavaScript is no exception. In JavaScript, scopes are divided by functions, not by blocks (while,if).
Let's take a look at a simple scope example.
[Ctrl + A
(a) Addevent
The most popular version on the web is Scott Andrew, who is said to have played a game in the JavaScript world (which we can see on page 100th of Pro JavaScript techniques) or browse the PPK Web site to solicit the functions for adding
A bad time to answer, especially undefined, because this involves the realization of the principle of undefined. So, after thinking carefully, write down this article, please heroes to shoot bricks.Total known: null = = undefinedHowever: null!==
However, there are some details that are not well known to us. John Resig, after analyzing these details, provides us with a perfect solution, which is described in detail in this article:
The details of the traditional methods not known
There is
1. Writing JS functions
2. HTML element to show/hide plus id attribute
control the show/hide of this TR
3, add buttons, links, etc trigger JS function
Show/Hide
JavaScript shows hidden layers Advertising
Two: JavaScript controls
Figure 1 (a div pops up)
Figure 2 (Eject multiple)constructor function:
Copy Code code as follows:
var divwindow= function (popup/* the outermost div id*/,popup_drag/* drag div id*/,popup_exit/* exit button id*/, exitbutton/*
Overview of basic types and reference types
The values of data types in JS include: base type values and reference type values
Basic data type: undefined;null;boolean;number;string
Reference type value: In memory, JS does not allow direct access
JavaScript itself, as a simple language, makes many people dizzy as much as its variable scope problem, mainly because of the existence of JavaScript closures. This article is not going to delve into the scope of JavaScript variables (in fact, I
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