Api:Find keywords: 4 kinds:1. Find the location of fixed keywords:var i=str.indexof ("keywords", Fromi);var i=str.lastindexof ("keywords", Fromi);Problem: Regular is not supported2. Determine if there are any keywords that contain and match the
Cookies, sometimes in their plural form, are the data (usually encrypted) stored on the user's local terminal by certain websites in order to identify the user and track the session. Definitions of RFC2109 and 2965 have been deprecated, and the
This time it gives a reasonable cookie operation code: var Cookie = { get:function (k) { return (new RegExp ("(?:;)?", K, "= ([^;] *);?"]. Join ("")). Test (Document.cookie) && regexp["$"]) | | ""; }, set:function (k, V, E, d) {
Gets the current time, format yyyy-mm-dd function getnowformatdate () { var date = new date (); var seperator1 = "-"; var year = date.getfullyear (); var month = Date.getmonth () + 1; var strdate = date.getdate (
When using Sdmenu.js in a project, you need to clear cookies at logon, and Sdmenu will save cookies by default
Here's how to save cookies sdmenu.js
Document.cookie = "Sdmenu_" + encodeuricomponent (this.menu.id) + "=" + States.join ("") + ";
function Getbyclass (oparent,sclass) {//Get element based on classvar oreasult=[];var oele=oparent.getelementsbytagname ("*");for (i=0;iif (Oele[i].classname==sclass) {Oreasult.push (Oele[i])}};return oreasult;}function GetStyle (obj, name) {//Gets
1. Current system time Var date=new date ();2. String turn time object var date=new date ("2018-01-01");3. Year of acquisition: Var year=date.getfullyear ();4. Get month: Var month=date.getmonth () +1;5. Get the number of days: Var day=date.getdate (
This calendar control is similar to a garden calendar, as shown in the following illustration:
This calendar control is not difficult to implement, the following simple analysis of my ideas:
First, it is a configurable item for the control:
1, the concept of javascript: is a language of expression, but also an object-based (object) and event-driven (EventDriven), secure script language, running on the client, thereby reducing the burden on the server side, summed up as follows:
Here is the sample code
First effect:
Jsondateformat (jsondate) {//json date format converted to normal format
try {
var date = new Date (parseint ( Jsondate.replace ("/date", ""). Replace (")/", "");
var month = Date.getmonth () + 1
What is JScript?
JScript is an Active scripting language developed by Microsoft and is implemented based on the ECMASCRIPT specification. JavaScript in Internet Explorer, in effect, refers to JScript. JScript has been supported by Windows Script
This nan is not nan:
The program code is as follows:
Copy Code code as follows:
var date =new date (d);
if (!date | |!date.getfullyear) {
Return
}
Return S.date.format (d, ' yyyy-mm-dd ');//Format function, not related
Usually, the website designer uses the backstage database to achieve the above goal. When the user first accesses the Web site, the site creates a new ID in the database and sends the ID to the user via a cookie. When the user visits again, the
In recent days, in doing Baidu map, you need to convert time format and do display, but found that the time format displayed, there was confusion, both the date and hours have changed. For example:
Raw time format: Thu Aug 20:38:54 CST 2016Convert
1. Get Year date
function Getnowformatdate () {
var date = new Date ();
var seperator1 = "-";
var Seperator2 = ":";
var month = Date.getmonth () + 1;
var strdate = Date.getdate ();
if (month >= 1 && month = 0 && strdate
2.
Creating and storing cookiesIn this example we want to create a cookie that stores the visitor's name. When visitors visit the site for the first time, they are asked to fill in their names. The name is stored in the cookie. When visitors visit the
Get the number of days in a month
I believe that when you read primary school, you will know how many days a year 12 months, there is a special existence-February. The February leap year has 29 days, non leap year February is only 28 days. It is
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.