JS cannot clear the cookie solutionWhen you use Sdmenu.js in your project, you need to clear the cookie when you log on, and Sdmenu will save the cookie by default. Here's how sdmenu.js saves cookies Document.cookie = "Sdmenu_" + encodeuricomponent (
Previous wordsThis article will introduce several key points of JS programming style in detailLoose couplingLoosely coupled when you modify a component without needing to change other components1. Draw js out of CSS: do not use CSS expressionsBad
1:javascript Case Sensitive
2:javascript Each statement must be ";" End, same as C language
3: Output: document.write ("string")---> can also output the corresponding HTML markup
4: Change the color of the form document.bgcolor= "red";
4: Type
JavaScript does not support real classes in languages like Java, C #, and so on. However, in JS can be defined pseudo class. The tool to do this is the constructor and the prototype object. First, the constructor in JS is introduced.
The syntax for
The syntax for creating objects in JavaScript is the invocation of a function after the new operator. Such as
Copy Code code as follows:
var obj = new Object ();
var date = new Date ();
Operator new first creates a new
js operation cookies:
has always been simple to JS to implement some of the cookies operation, today the cookie operating system of the collation of the first time, including: JS read cookie,js add cookie,js delete cookies, examples are as follows:
I implemented the method is to record each column has a drag object, so that at the beginning or refresh when the column has to read which drag objects, directly drag the object through the Appenchild to add in it, such as dragging the column ID is
Last article: Use JS read, write, delete cookie code sharing and detailed notes, in practice, found some problems:
1.cookie can only be debugged on Firefox on local files, IE and chrome are not valid
2.cookie is not set to never expire, it is
Time stamps and time-date conversions are common operations, and here are examples of how to implement the conversion between them through a code instance.
Before you learn this article, let's introduce the date () constructor parameters in
Article Introduction: 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
Socket.io Online chat Room
The Nodejs series of articles from scratch will introduce how JavaScript can be done as a server-side script through the NODEJS Framework web development. The NODEJS framework is a V8 based engine and is the fastest
datetime Control
Bootstrap a DateTime control, which is very simple to use.
First, add a reference to the date-time control
@*datetime control *@
Link: http://pan.baidu.com/s/1sl56aw1 Password: jc2yPage code
JS generates a lot of random numbers, Math.floor (N*math.random ()) is one of the commonly used methods, today is to say is based on the "Hull-dobell theorem" algorithm (referring to http://www.zhihu.com/ question/22818104), the height of the
JavaScript Knowledge points Summary (must read)reprinted 2016-06-10 submission: Jingxian I want to commentThe following small series for everyone to bring a JavaScript knowledge point summary (Must read). Small series feel very good, now share to
One: Models and propertiesThe model is the cornerstone of the MVC application, which is responsible for storing the data required by the application, validating the data, performing access control, and implementing the specific business logic needed
We usually verify the date in JavaScript, the basic idea is to determine whether the day is valid, and then judge whether the month has the day, such as some months without 31st, excepting Hile No 29, 30th, Leap year February without 30th and so on.
Detect if the browser supports cookies
function Checkcookie () {
To determine whether a cookie is turned on
var cookieenabled= (navigator.cookieenabled)? True:false;
If the browser is not ie4+ or ns6+
if (typeof navigator.cookieenabled== "undefined"
has always been simple to JS to implement some of the cookies operation, today the cookie operating system of the collation of the first time, including: JS read cookie,js add cookie,js delete cookies, examples are as follows:
Copy Code code
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.