Http://www.cnblogs.com/sink_cup/archive/2010/12/16/javascript_screen_width.html
Javascript detects your resolution and the font size is set automatically
Window. onresize
Different ie Firefox values
Region description
JavaScript code
Visible area width
Document. Body. clientwidth
High visible area of webpage
Document. Body. clientheight
Visible area width
1. Why is arguments not an array? How to prove it?
Arguments does not have array slice or other methods, so they are not of the array type.
Verification:
FunctionTestargs (){VaRArr = [1, 2, 3]; Console. Log (TypeofArguments. Slice); console.
The preventdefault method is used to prevent the occurrence of its default behavior from other things. This article provides a method that is compatible with various browsers to prevent default behaviors.
JS blocks link redirection
The
Last timeArticleThis section describes how to "encapsulate" data and methods to generate instances from prototype objects.
Today we will introduce how to "inherit" between multiple prototype objects ".
For example, there is an "animal" object,
Why is the current mainstreamProgramAre all objects created in the language? The following definition gives us an answer:
In object-oriented languages, objects are defined as anything that people want to study. From the simplest integer to the
With years of software development experience, I know that it is better to do technology whatever you think. Even if you read the source code, you should not just read it, when doing this, you will experience the ingenious design of the masters.
With F12, Web developers can quickly debug JavaScript without leaving the browser.Code. Built into each Windows Internet Explorer 9 installation, the F12 tool provides debugging tools (such as breakpoint, monitoring, and local variable viewing) and
Preface
Today, it was a little quick because I studied MVC in the morning and found that MVC is not suitable for front-end development. I have seen several front-end predecessors recommend using mvvm on the front-end, but I still don't know much
2.9 operator 2.9.1, unary operator
The unary operator has only one parameter, that is, the object or value to be operated.
1. Delete:Delete references to previously defined object attributes or methods. However, this operator cannot delete
Baidu front-end interview questions,CodeAs follows:
VaRA = 5; FunctionTest (){ A = 0; Alert (); Alert (This. ); VaRA; Alert (); } Test (); NewTest (); Run it on chrome. The result is: 0 5 0 0 Undefined 0 The first three results
Original article: http://www.nczonline.net/blog/2012/10/16/does-javascript-need-classes/
Note: During my one-year career, I have met someone who calls constructors as classes, and someone who calls objects as classes. this is more painful
CodeAs follows:
Function Numinstring (STR ){STR = Str. Replace (// ig ,""); VaR Strarr = Str. Split (""); VaR Result = [], beforelength, afterlength, reg; For ( VaR I = 0; I If (Str. indexof (strarr [I])! =-1 ){Beforelength = Str. length;Reg =
Window Object window operations
Window objects are very useful for operating browser windows. developers can move or adjust the size of browser windows. You can perform these operations in four ways:
MoveBy (dx, Dy): Move DX pixels horizontally
Create an array object
// One VaR Avalues = New Array (); // Two VaR Avalues = New Array (20 ); // Three VaR Acolors =New Array ();Acolors [0] = "red ";Acolors [1] = "green ";Acolors [2] = "blue "; // Four VaR Acolors = New Array
Inheritance
Inheritance is an essential feature of object-oriented languages. That is, one class can reuse the methods and attributes of another class. In JavaScript, the inheritance methods include the following methods: Object impersonating, call
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