JS setFullYear () toutcstring () getday () Example Tutorial
First look at the setFullYear () Example:
Results.
Thu Nov 2008 08:32:43 UTC
toUTCString () instance.
Answer Thu, Nov 2008 08:36:36 UTC
Getday ()
Use Getday () and an array to write a business day, not just a number.
result.
Today it is Thursday
cgi|javascript|js| Tutorial
Use JavaScript instead of CGI
You might be familiar with CGI scripts, and you can use CGI to pass numbers or variables from one page to another on a form. Of course, you can use "POST" to pass a variable to a separate thread without appearing in the browser, or to encode the variable to a URL using "get".
JavaScript cannot use the Post method when a variable is processed on the s
For more information about how to use jsdatetime, see.
The Code is as follows:
// Convert a Date string such as "10:18:30" to a Date objectVar strArray = str. split ("");Var strDate = strArray [0]. split ("-");Var strTime = strArray [1]. split (":");Var a = new Date (strDate [0], (strDate [1]-parseInt (1), strDate [2], strTime [0], strTime [1], strTime [2])
2: The second method is really simple.
Var s = "09:41:30 ";
Var d = new Date (Date. parse (s. replace (/-/g ,"/")));
-------------------
ument. getElementById (); obtain the html element in the subwindow object
2) reference the parent window in the Child Window
Code in the subwindow:
Using metadata opener.doc ument. getElementById (); obtain the html element in the parent window
Window. opener: refers to the reference to the parent window object of the current window, indicating the window object of the parent window
# P # php tutorial-javascript programming-bom in
JavaScript: several methods for JS to obtain HTML elements in a webpage. Javascript tutorial
GetElementById getElementsByName getElementsByTagName
GetElementById, getElementsByName, getElementsByTagName
The last two are the collection, and the byid is only a single object.
GetElementById usage
For example:
Taoba
Reference Method on the same page:
1. Use id:
Link1.href, return a http://homepage.yesky.com
2
[Js master path] html5 canvas animation tutorial,
In the previous section, we talked about constant motion, and the motion shared in this section is even more interesting:
Acceleration
Gravity Acceleration
Parabolic motion
Friction
Acceleration:
1
Acceleration decomposition and Synthesis
1
Parabolic motion:
1
Gravity bounce:
1
Parabolic and gravity bounce
1
Friction Motion
1
JS BasicsGrammar' Use strict ' (strict mode)Defining variablesvar object; Declare unassigned only, default value is undefined;var object1= value; Declare and assign value;function Fun (a) {This is also called a local variablevar obj=[] This is called a local variable and cannot be called in the outer body of the functionObjct1=[] is called a global variable, which can be used when the function name is called once.}Multi-variable definitionvar a,b,cx=1
The JS keyboard control event tutorial obtains keyboard control events, which is one of the most interactive methods. The first thing you need to know is how to initialize the event. The basic statement is as follows: document. onkeydown = keydown when the browser reads this statement, it calls the keydown () function no matter which key is pressed on the keyboard. Capturing Keyboard Events is a little diff
As we all know, jQuery is now very popular, and jQuery has already been used on Baidu's new homepage. Today we will summarize how to write better jQuery code to make jQuery Code better and faster to execute, I hope this jQuery tutorial will change your previous unreasonable practices.
1. Correctly reference jQuery1. Try to introduce jQuery before the body ends, rather than in the head.2. Use a third-party CDN to introduce jQuery. Note that when a pro
I. Methods of UseThe HTML structure of the canvas plugin is very simple, which is to use a tag:You can then invoke the plug-in using the following method:function init () {document.getElementById (' Portrait-image '). Closepixelate ([{resolution:24},{shape: ' Circle ', resolution:24, Size:16, Offset:12, alpha:0.5}]);};Window.addeventlistener (' Load ', init, false);Second, the structure function and the methodvar Img=document.getelementbyid (' portrait-img ');var mypixelation=new closepixelatio
Original addressWe learned about the creation of maps and markers in the front. So today we're going to learn how to display a window on a map (Infowindow)The Infowindow constructor is:Infowindow (opts?:infowindowoptions). The infowindowoptions Object Specifies the initialization parameters that are used to display the information window. Infowindowoptions Object Properties:content: contains a text string or displays a DOM node in the Information window. Pixeloffset: represents the position offs
cookies httpOnly .HistoryhistoryThe object holds the browser's history, and JavaScript can invoke the history object back() or the forward () user clicks the browser's back or forward button.This object belongs to the historical legacy, and for modern web pages, a simple and brutal invocation can be very annoying to users because of the large use of Ajax and page interactions history.back() .When a novice starts designing a Web page, he likes to call when the login page is successful history.ba
Transferred from: http://blog.csdn.net/lulei9876/article/details/8494337When self-study jquery, saw an English word (Callback), immediately back faint cold sweat. Google quickly found that the original Chinese translation into a callback. That is, the callback function. Do not understand Ah, so in the Google callback function, found that the online Chinese interpretation is too "abstruse", I admit that I caishuxueqian. After looking at some examples of callbacks, it seems a bit understandable. H
(‘false‘); // true! ‘false‘字符串转换结果为true!因为它是非空字符串!var b3 = Boolean(‘‘); // falsevar s = String(123.45); // ‘123.45‘typeof s; // ‘string‘Did you feel a big head? This is the hypnotic charm peculiar to JavaScript!To summarize, there are a few rules to follow:
Do not new Number() use new Boolean() , new String() create packaging objects;
Use parseInt() or parseFloat() to convert any type to number ;
The String() method used to convert any type to string , or directly invoke, an obj
1. Uppercase,lowercase Case Conversion{{' lower cap string '|}} //Result: LOWER CAP STRING{{"TANK is good"|}} //Result: Tank is good 2. Date format{{1490161945000| date:"Yyyy-mm-dd HH:mm:ss"}}//2017-03-22 13:52:25 3, number formatting (keep decimals){{149016.1945000| number:2}} 4. Currency Currency format{{]|}} //Result: $250.00{{] | currency:"Rmb¥"}}//Result: rmb¥250.00 5. Filter LookupInput filters can be added to the directive with a pipe character (|) and a filter followed by a
is an object, then the properties inside the object are allowed to be modified.. cannot be duplicate with other identifiers1 Const user = ' GHOSTWU '; 2 console.log (user); 3 user = ' Zhangsan '; Error, cannot be re-assigned value1 const user; Error, no initial value given at the time of definition Constuser={name : ' GHOSTWU ' }; console.log (user.name);//ghostwu user.name= ' Zhangsan '; properties of //objects allowed to be modified console.log (user.name); //zhangsan Const USER = {name: ' G
Uniform motion: Refers to the movement of an object in a straight line, and the displacement of an object through any equal time interval is equal. In fact, it is uniform motion, it is characterized by an acceleration of 0, from the definition, in any equal time interval, the speed and direction are the same.1238 - to + -The above example lets a small ball with a radius of 20px from x=0, y=canvas the height of half, at 2px per frame speed to the right uniform motion.We can encapsulate the ball i
SMS Verification Code countdown can be very good to avoid frequent user access, usually using the JS implementation to obtain SMS Verification code countdown function, the specific implementation of the following:HTML section:Page effect:JS section:Final implementation effectReproduced in this article: http://www.lx598.com/hangyedongtai/1028.htmlJS implementation to send SMS Verification Code Countdown tutorial
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.