This is a not dependent on any JS framework, pure JavaScript implementation of the gallery effect. It supports mobile device gesture operation, such as gesture touch sliding, zooming in and off pictures, it also supports keyboard operation on PC, in
1. Current system locale format (tolocaledatestring and tolocaletimestring)
Example: (new Date ()). toLocaleDateString () + "" + (new Date ()). toLocaleTimeString ()Results: January 29, 2008 16:13:11
2. Ordinary strings (todatestring and
JavaScript usage
The code is as follows
Copy Code
var Obj=document.getelementbyid (Selectid);obj.options.length = 0; Clear All contentObj.options[index] = new Option ("three", 3); Change the corresponding
The following code is already in the original page and cannot be changed, and the class label is unique on the page:
The code is as follows
Copy Code
user100
Now I want to get the link UID number 100 in the a
Description of defer phenomenon
The code is as follows
Copy Code
javascript defer attribute test page-tests deferring scripts in browsers The outer chain of the href= "javascript:;" >test Defer attribute
Getboundingclientrect (); This method gets the position of the left, top, right, and bottom of an element in the page relative to the browser window, and he returns an object, object, that has an attribute: Top,left,right,bottom Here, the top, the
What is a regular expression?
This problem can be seen in the "regular expression 30 minutes introductory Tutorial", where many programming languages support regular expressions, and this article only discusses regular expressions in JavaScript.
Here we look at a piece of code, in fact, the display and hidden layer are using JS to get div ID then set his CSS tutorial style for Bolck or hidden on it, the following look at the function.
Call method
Show
The layer to display
We use the function getday (), getmonth (), getseconds (), getFullYear (), getmilliseconds (), etc.
Get the day data,date:get day
Month
Date:get Month
Seconds
Date:get Seconds
Years
Alert (Mydate.getfullyear ()); " >Date:get Full yearMinutes
Returns a string that is used to represent the data type of an expression.
typeof[() expression[]];
The expression parameter is any expression that needs to find the type information.
DescriptionThe typeof operator returns the type information as
Using the Web page effect to determine the current URL routing and jump to the designated page, the two examples used indexof function and substring function to determine the access to the reference is not our provisions of the entrance Oh.
Example
/^ ([0-9a-z][0-9a-z_]*[0-9a-z]|[ 0-9a-z]) @[a-z0-9.-]+. [A-z] {2,4}$/i
Do not have too many restrictions on the content after @, can be modified as needed
Verify mailbox format
function Check_email (obj) {
var reg =/^[a-za-
New Document
Look at an instance that gets the checkbox value
New Document Multiple personalities Lotte Philosophical Mature and stable Childish naughty Gentle and considerate Lively and lovely Ordinary Introverted shyness
This article provides a detailed tutorial on the If Else processing conditions (Web page special Effects Tutorial II), it is very simple to mention a few examples of JS in the if else conditions set up and not set up a detailed tutorial.
Tip: you can modify some code before running Default Browser style Select1Select2Select3Select4 Js simulates the select statement. For the style, refer to IE8 and Firefox. Select1 Select2 Select3 Select4 You can change other styles without
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