JavaScript code:
Copy Code code as follows:
function Get_page_size ()
{
var re = {};
if (document.documentelement && document.documentElement.clientHeight)
{
var doc = document.documentelement;
Re.width = (doc.clientwidth>
1, to prevent misuse of JavaScript "no matter what Web page you want to change through JavaScript, you must think twice before you do it." The first thing to confirm is: Is it really necessary to add this extra behavior to the Web page? ”
Cycle is the basic function of most programming languages, JS is no exception, the difference is that JS is an interpreted language, running in the browser environment, the client's hardware and software conditions will have a great impact on the
Traditionally, loading JavaScript files is the use of
tags are convenient, the browser will read and run as long as you join the Web page. However, it has some serious flaws.
(1) Strict reading order. Because browsers read JavaScript files in
Two ways to solve the common Chinese characters of Ajax
1. encodeURI on the client (Utf-8 also can not do, default), on the server side of the Iso-8859-1 code into UTF-8 encoding
2. Two encodeURI on the client and one conversion on the server side.
What are the methods of accessing node objects in JavaScript?
Copy Code code as follows:
var obj = document.getElementById (' FDAFDA ');
var obj = document.f1;
Obj.method= "POST";
obj.action= ' Bb ';
var obj =
JavaScript has four semantics in parentheses
Semantic 1, declaring an array
Copy Code code as follows:
var ary = []; Declare an empty array
var ary = [1,3]; Declare an array, and assign an initial value
Semantic 2, taking
The CKEditor Editor is an upgraded version of FCKeditorThink for FCK, it is really easy to use, loading speed is also relatively fastThe following is for form validation if you get the value of the CKEditor editor through JS
if
Copy Code code as follows:
list Test
Note 1: Move left and right to select
Note: This page is only tested under ie6/firefox1.5. Other browsers or other versions have not been tested.
Multiple= "multiple"
Copy Code code as follows:
function Gaga (obj) {//value allows you to enter a decimal point and number
Obj.value = Obj.value.replace (/[^\d.) /g, ""); First, replace the non-numeric, except for the numbers and.
Obj.value = Obj.value.replace (/
First, I'll throw a conclusion: " in JavaScript, the This keyword always points to the owner of the function (method) ."
Function
Copy Code code as follows:
function introduce () {
Alert ("Hello, I am laruence\r\n");
}
For
Page page to achieve a lot of ways, the following to JS as an example for you to introduce the details of the table page effect of the specific implementation.
Copy Code code as follows:
Page---www.jb51.net
Total 6
Often, you can see Array.prototype.slice (arguments, 0); This method can be used in function () {}, which converts the argument list of functions to a true array. Take a look at an example:
Copy Code code as follows:
var slice =
As shown below:
Copy Code code as follows:
function Saomiao (event,n)
{
var code=0;
code=event.keycode;//listening for keyboard input events
if (code== ' 13 ')//If the keyboard enters the ENTER key
{
if (n>0)//Start judging
JavaScript is object-based, and any element can be viewed as an object. However, types and objects are different. In this article, in addition to discussing some of the features of types and objects, it is more important to look at how to write good
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.