In the previous article , I mentioned that we should create multiple styles for my microblog and then randomly load the style on each visit to keep Weibo fresh. Although the idea and implementation are relatively simple, but still want to record
Random load CSS style JS effect is actually very good implementation, the code of this article is as follows, the specific idea is to use a default CSS style: Default.css. Another css:skin1.css,skin2.css,skin3.css with three other names. Of course,
JavaScript Entry code collation, for the Java script is not familiar to the master only one step away from the person.
JS Getting Started code 2009/04/21 13:59JS Entry Code
Fit to read: Don't know anything about Java Script ~ One step away from
58 Classic JS Code collection, I hope to help you.
1. oncontextmenu= "Window.event.returnvalue=false" will completely screen the right mouse buttonno available for table
2. deselect, prevent copying
3. onpaste= "return false" is not allowed to
JavaScript is a list of commonly used functions to facilitate their own inquiries.
The click () object. Click () to cause the object to be clicked.Closed object. Closed Object window is closed True/falseCleartimeout (object) clears the SetTimeout
JavaScript does not support multidimensional arrays, but because arrays can contain objects (arrays are also objects), arrays can be nested to implement functions similar to multidimensional arrays.
1. Understanding Arrays
An array is a collection
Use JavaScript to manipulate cookies, write cookies, and remove cookies.
Save cookies:
function Setcookie (name, value)//two parameters, one is the name of the cookie, one is the value
{var days = 30; This cookie will be saved for 30 daysvar exp =
Organize some commonly used JS functions, I hope to help you.
1, Dayin ()
function:Create a new page and print the ID dayin content to solve the problem of printing portions of a page.
How to use:The content to be printed is contained by , and then
To share with you often use the JS verification script, very practical, like to collect it.
1//================================================================2//This function is used to limit the number "0" to "9" in the text input box, ".", "-"3//=
function Setcookie (name,value)//two parameters, one is the name of the cookie, one is the value
{
var days=30;//Save 30 days
var exp = new Date (); New Date ("December 31, 9998");
Exp.settime (Exp.gettime () + days*24*60*60*1000);
Document.cookie =
Tips
How to add a date to the page in the second episodeWe want to tell you an example of the use of dates and times, from your personal client machine to get the date and time.
The procedure is as follows:
In this case, we must first establish a
Cookies
Problem:Makes it possible to follow the previous settings when accessing a page, or to share data between different pages. For example, when users visit the site to set the size of the page font, then you will want to visit the next time you
Technique eighth how to automatically add the last modification time
After we have finished the HTML file, we usually add the date of the last modification of a line of files. Now you don't have to worry about every time you have to change or
How to use JavaScript to determine whether the date of entry is legal
function Isvalidyear (psyear){var syear = new String (psyear);
if (psyear==null){return false;}
if (isNaN (psyear) ==true){return false;}
if (Syear = ""){return true;}
if
Skill
This is a blog about JavaScript, which I saw on the clang. The author introduced quite comprehensive, so reprinted to let interested friends to see. Oh ~ ~ ~ ~
There are times when you are proficient in a language, but it turns out that
javascript| Functions | Tutorials The Date object can be created using the date () constructor, and we have introduced the date () constructor in the previous tutorial, and there is no repetition here. It has no parameters, and the returned value 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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service