When we write the JS code, The Window.onload event is typically added to select a DOM element to use, such as Getelementbyid,getelementsbytagname, after the DOM finishes loading, but Window.load waits until the DOM is loaded , scripts, CSS, the
Method One, all JS copied to the clipping version
Can be compatible with basically all of the mainstream browsers (IE,FF), a lot of places to use:
The code is as follows
Copy Code
CopyToClipboard = function (TXT) {if
Oh, for a long time did not write articles, the recent contact with JS compare how long by the way to write a JS-related article.
Well, thank you today for variables related to it, variable this thing as long as you are knocking on the code every
Reload method that forces the browser to refresh the current page.
Syntax: Location.reload ([bforceget]) parameter: bforceget, optional parameter, default to False, take current page from client cache. True to get the latest page from the service,
Effect chart
Plug-in information:Name:imgscroll
version:13.09.09Author:lazyE-mail:25565308@qq.com
Parameter description:ID: The ID value required to scroll the windowWidth: Window widthsHeight: Window heightDir: Picture scrolling direction,
In the JS code, because of the differences in behavior between browsers, we often include a large number of if statements in the function to check browser features to resolve compatibility issues with different browsers. For example, our most common
About JS in the event monitoring everyone uses more, but is to determine whether the browser support AddEventListener and attachevent, online search on the event monitoring methods are quite many, but some are not very perfect. The following method
. Dom:document object model is an application for HTML and XML documents API.DOM provides structured document representations.Allows the program to modify the document's content and visual representation. Essentially, it connects web pages to
code is as follows
copy code
Take X axis positionfunction MouseX (evt) {Firefoxif (Evt.pagex) return evt.pagex;Ieelse if (EVT.CLIENTX)return Evt.clientx + (Document.documentElement.scrollLeft document.documentElement.scrollLeft:
Offsetwidth/offsetheight method of getting elements from Web page effectsThe idea is simple: get the offsetwidth/offsetheight of the element, minus the padding and border of the elementelement to set the Width/height by introducing a style sheet
can only enter Chinese
The code is as follows
Copy Code
Can only enter Chinese ================//
The code is as follows
Copy Code
if (type== "R_china"){if (Value.search (/^[/u4e00-
The code is as follows
Copy Code
function CheckValue (){if (isNaN (Document.all.textbox.value)){Alert ("Please use digital input!") ");return false;}}
Cases
InstanceIn this case, we'll use Isfinite () to detect infinite
Singleton mode is a common mode. If you want only one instance for a class in the system, Singleton mode is the best solution.1. Singleton mode definitionDefinition of Singleton mode: ensure that a class has only one instance, and provide a global
There is a jQuery plug-in Typed. js on the Internet that can simulate character-by-character input. This post uses Js + css to achieve this effect.Sentence to be output: HelloJavaScript. The property of the above element is Den.JavaScript:Css:Share
Tip: you can modify some code before running Javascript focus chart with small thumbnails switch javascript code onlyWebpage special effects homepage image switching Top web games in 2008 Latest web games in 20
Tip: you can modify some code before running Javascript anti-Kaixin.com friends impression special effect codeFixedYou don't know what to do if you're a hacker -...... -Take a rest, watch the rest, and repair people who have crush on working in the
Window. location can obtain a series of information in the address bar, and each browser supports this attribute, which is very convenient. The parameters after the obtained question mark can be processed into the desired key-value pair.Location
GUID (globally unified identifier) refers to the number generated on a machine, which ensures that all machines in the same time and space are unique. Generally, the platform provides APIs for generating GUIDs. The generation algorithm is very
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