Javascript knowledge collection
1. Four browsers explain clientHeight, offsetHeight, and scrollHeight of document. body.
These four browsers are IE (Internet Explorer), NS (Netscape), Opera, and FF (FireFox ).
ClientHeight
Everyone has no
Using jquery to locate demo: http://www.healdream.com/upLoad/html/jquery/position/
Down: http://www.51files.com /? Z25US63TM6OBHQJ2XM58
Usage:
First of all, it includes two JavaScript codes.
The Code is as follows:
Based on the browser type, the screen resolution automatically calls different CSS codes to determine both the resolution and the browser
Rewrite the Code to make it the code that automatically calls different CSS to determine the screen resolution
How does javascript judge whether the elements in the Array are repeated? var str = new Array ();
For example, there is an array with 20 18-digit ID card numbers.
Check whether the ID card number is repeated.
How to quickly determine?
The Code is
[Share] a very beautiful progress scroll bar
var lightRGB = new Array (255,255,255 ); initColor ("# 0000FF"); function initColor (Color) {var opArray = new Array (. 10 ,. 25 ,. 50 ,. 75, 1.0);
Paging functions implemented by Javascript /**
* Paging Class Construction
* Parameter nTotalList: Total number of entries
* Parameter nPageSize: number of entries displayed per page
* Parameter nPageNum: Current page number
* Parameter sPageUrl:
The specified content cannot be selected through script control
The specified content cannot be selected through script control _ typical special effects
Other examples:
How can I use JS to obtain the median with "" string?
Method 1:Var test = "c: \ abc \ 123.txt ";
Alert (test. lastIndexOf ("\\"));
For some special characters, escape characters "\" "\" are used to represent"
As for getting the 123 in the
Background, text gradient (non-flashing screen)
Background Conversion
2/3 | c = 0) & c 0) {c -- d [a] = 1;} else d [a] = 0 ;} return c} function do_it (a, c) {if (d [a] = 2 & c 0) | c = 255) {c --; d [a] = 1;} if (a = 3) {if (d [1] = 0 & d [2] =
Some tips on using JS to operate on page tables and elements (1)
The operations on table labels vary with ie, firefox, and other browsers. in ie, assigning values to innerHTML of table and tr is not allowed. When adding a tr using js, the
JavaScript is an interpreted language, so it cannot reach the level of CJava and so on. It limits what it can do on the client. In order to improve its performance, I want to talk about my experience based on the many tests I have done for
The code syntax is highlighted in dp. syntaxHighlighter: So far, blogs have been using LBS, and I feel that many of my favorite features are missing. This time, I finally made up my mind to write my BLOG program to be compatible with my previous
Javascript IE and Firefox compatibility assembly (zz) 1. document. form. item Problem
(1) existing problems:
Many statements such as document. formName. item ("itemName") exist in the existing code and cannot be run in MF.
(2) solution:
Use document.
Javascript judges the specific class of an object. We all know that the typeof Javascript can obtain the type of the variable. However, there are only six types of typeof return values: "number," "string," "boolean," "object, "" function, "and"
Tips for webpage creation (continued)
Q:
Double-click automatic screen scrolling.
A:Add the following code to the page for automatic screen scrolling
Var currentpos, timer;Function initialize (){Timer = setInterval ("scrollwindow ()", 1
How to control a set of Single-choice buttons (radio)
script function SenFe_Code (sname, sid) {if (sname. checked) {sid. style. display = "block";} else {sid. style. display = "none" ;}} script Title 1 details 1 Title 2 details 2 Title 3
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