getmonth () Gets the month (0-11) getfullyear () Gets the full year getyear ( Gets the Year gethours () Gets the Hour getminutes () Gets the Minute getseconds () Gets the Seconds getmilliseconds () Gets the milliseconds gettime () returns the cumulative number of milliseconds (from 1970/1/1 Midnight)Application Example: Output the current time, such as: "June 18, 2014 15:40:30 Wednesday"functiong
Deep Learning Seajs configuration information alias : alias configuration paths : path configuration vars : variable configuration map : map configuration preload : pre-add-ons debug : Debug mode base : Base Path CharSet : file EncodingDeep Learning Seajsmoduleid : module Unique identifier URI : module Absolute path dependencies : The current module relies on exports : Current module
; }; //------------------------------------------------------------------------------ /*This code is based on the performance tests at Http://jsperf.com/b64tests * This 12-bit-at-a-time algorithm was T He best performing version on all * platforms tested. */ varB64_6bit = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz0123456789+/"; //one-dimensional arrays instead of two-dimensional arrays varB64_12bit; //64x64 table, all axes are b64_6bit 64 characters varB64_12bittabl
Speaking directly from the method:
1, delete the node. RemoveChild ():
If you do not know what the parent node of the node you want to delete is? You can use the ParentNode property.
Like what:
2, replace the node. Repalcechild ()
Element.repalcechild (NewNode, OldNode); The new node is the guest, must first serve him slightly. The OldNode must be a child node of the element.
Example:
3, find the node
Finding nodes is relatively straightforward r
entry file:Inside the index file, we initialize an associative array to hold the functions that need to be used. and turn on the server.Server file:First, we set the encoded format of the received data to UTF-8, then register the listener for the "data" event to collect the new block of data received each time and assign it to the PostData variable, and finally, we move the call to the request route to the end event handler, To make sure it only fires when all data is received and fires only on
Js object-oriented learning note 2 (debug debugging method)1. js debugging
Obviously, js debugging can only be printed through alert
alert(id);
For complex data types, we can convert them to json format before the pop-up
alert(JSON.stringify(data));
A file is a moduleExports public interfaceCreate Exports.jsTwo common interfaces available externally: Set value, squarevar i;exports.set = function (num) {//Set value i=num; Console.log ("Seti to" +i); Exports.square = function () {//squared and output I=math.pow (i,2); Console.log ("i^2=" +i);Require Get External interfaceCreate Require.jsvar square =require ("./exports");/
successive accesses are not affected by the visitor.Idempotent means that repeated requests are the same as the effect of a request more than once.Express has designed different route binding functions for each HTTP request methodWhere: The App.all function supports the binding of all request methods to the same response function, which is a very flexible function.4. Transfer of control rightsExpress supports multiple route response functions on the same path, but when accessing any path that i
("'); Console.Log(' files: '+F.length); F.ForEach(function(FN){ Console.Log("---"+fn; }); })}Else{ FS.ReadFile(dir+'/'+File,"UTF8",function(Err,Data{ Console.Log(" "+Dir; Console.Log("\033[90m]+Data+"\033[39m]); }); } } });}effect :Code Analysis:The whole small program code is very simple, compared to the C languag
variables, or global functions, put them outside the if,for, etc.The FOR function does not use the defined variable i directly, otherwise there will be a hidden danger (we should be very careful when using the For loop, put in a different position, may be different values)For example:1 DOCTYPE HTML>2 HTML>3 Head>4 Metahttp-equiv= "Content-type"content= "text/html; charset=utf-8">5 title>Untitled Documenttitle>6 7 8 9 Head>Ten One Body> A - inputtyp
1, Function:
A function is a JS code that is defined once and can be invoked multiple times.
When a function is called by an object, the function is called the method of the object.
function Cssrain (x, y)
{
Code
}
Explain:
Cssrain: For the function of the name;
(): is an operator;
X, y: as parameter;
2, the return value of the function:
function A (x) {
document.write (x);
}
function B (y) {
document.wri
When using js, I often encounter some problems. I used my spare time to sort out some common problem solutions and post them to share with you, if you have any need, refer to section 1. Javascript Chinese and variables are case sensitive.
2. Single quotes and double quotes can be used to create strings without special differences in JavaScript. However, as a general rule, most developers prefer to use sing
results are the same as hasOwnProperty ();
4, isPrototypeOf () method:
If the object to which the method belongs is a prototype object of the parameter.
var a = {x:1, y:2};
var k1= Object.prototype.isPrototypeOf (a); O.constructor = Object
var k2= Object.prototype.isPrototypeOf (Function); Function.constructor = Object
Alert (K1)//true
Alert (K2)//true
5, array:
1 Create an array:
Array Direct Quantity:
var es = [];
Complex dot var es = [[1, {x:1,
undefined are equal.When checking for equality, null and undefined cannot be converted to other values.If an operand is NaN, the equal sign returns false, and the non-equal sign returns TRUE.If the two operands are objects, then their reference values are compared. If two operands point to the same object, then the equals sign returns TRUE, otherwise two operands are not equal.Relational operatorsOn both sides of the comparison operator if one is a numeric type and one is a different type, its
add an element to the arrayPush (3)PopShift to remove elements from the head of an arrayUnshift adding elements to the head of an arraySorting of arraysSort () sorts an arrayvar arr = [' Z ', ' A ', ' C ', ' B '];Sort (arr)var arr = [3,2,4,1]Sort number out problemNeed to give a comparison function sort (function (n1,n2) {return n1-n2})Concat () Connect two arraysARR3 = Arr1.concat (ARR2)Join () splits an arrayArr.join (', ')String Conversions to arraysvar str = ' All-in-all ';var arr = str.spl
5.2.5 operationConcat (); slice ();5.2.7 method of position operationThe others do not repeat5.5 Functions1, the function is actually an object, each function is an instance of the functions object, as with other reference types, have properties and methods.A function name is a pointer to a functional object.How to create a function:1. Functions are generally defined by function declaration syntaxfunction sum (num1,num2) {return num1+num2;}2. You can
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.