Example
The code is as follows
Copy Code
MSIE = Int (/msie (d+)/.exec ((navigator.useragent). toLowerCase ()) | | []) [1]);/* IE 11 changed its useragent format, so to further judge * *if (isNaN (MSIE)) {MSIE = int
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
Recently ready to do a mobile phone side of the site. So on the internet to find a few to determine whether it is a mobile phone browser JS script, posted up, share under:
1. How to determine whether to use the regular match for mobile terminals,
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,
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
The Window.settimeout method is used to delay the execution of a segment function (method). But it is in a certain defect when calling the specified method and passing the parameter. General direct reference, can only pass the parameters such as
The code is as follows
Copy Code
JS Code1. Determine if there is a value= "Paravalue" Item in the Select optionfunction Jsselectisexititem (Objselect, Objitemvalue) {var isexit = false;for (var i = 0; I if
The quickest way to JS
JS Code:
The code is as follows
Copy Code
function getquerystring (name){var reg = new RegExp ("(^|&)" + name + "= ([^&]*) (&|$)");var r = window.location.search.substr (1). Match (REG);if
For example, date 1 is 2009-8-1, date 2 is 2009-7-1.
Using the Split function to slice,
Method 1
The code is as follows
Copy Code
Method 2
JS Date comparison (YYYY-MM-DD)
The code is as follows
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:
1. Rounding
The following two functions can be rounded to the floating-point number, reserving two digits after the decimal point.
/** the following two functions can be rounded to the floating-point number, retaining two digits after the decimal
Web page effects Null object detailed
Null
This is an object, but is empty. Because it is an object, typeof null returns ' object '.
Null is a JavaScript reserved keyword.
Null is automatically converted to 0 when it participates in numeric
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
String.prototype.len=function () {return This.replace ([^x00-xff]/g, "AA"). Length;}
(2) Application: JavasCript does not have a trim function like VBScript, we can use this expression to implement
String.prototype.trim = function ()
{
Return
SOURCE ExampleOne: The JavaScript page automatically submits the form when it is trimmedForm form:
The code is as follows
Copy Code
JavaScript code:
Note: When submitting a form using JavaScript, do not use id=
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
Blob indicates binary raw data. A Blob object is a class file object containing read-only raw data.APIs that inherit Blob functions include:File object: processes binary data that exists in the File form, that is, operations on local files;FileList
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
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