Single JS ban page right menu--Avoid web site information stolen
Copy Code code as follows:
Copying on a Web page is largely accomplished by JavaScript.
Ondragstart= ' return false ' onbeforecopy= ' return False '
1 determining whether an array type
Copy Code code as follows:
2 determining whether a string type
Copy Code code as follows:
3 Determining whether a numeric type
Copy Code code as follows:
Here in the source code, did not do style processing, but the function is OK, I hope you can communicate with me!
Copy Code code as follows:
Click on the pop-up div selection Info
One: Calculate the number of days difference between two dates
Like what:str1 = "2002-01-20"str2 = "2002-10-11"How to use JavaScript to calculate the difference between str1 and str2 days?
Copy Code code as follows:
1. Pass value (by value)
The value of a variable is copied, which is irrelevant to the original value, which means that even if the new value is modified, the original value will not change, and the base type is passed in JavaScript.
Copy
Today, when reading the JavaScript Authority Guide, we found that there are two kinds of break syntax (break; and break label; Never looked carefully, on the first few pages.
But do not understand how to write label, so the internet search, found
When you judge a client file, you can use the
Copy Code code as follows:
var Fso,s=filespec; Filespec= "C:/path/myfile.txt"
Fso=new ActiveXObject ("Scripting.FileSystemObject");
if (FSO). FileExists (filespec))
s+= "exists."
A pen test to think about, usually no one will modify the parameter values inside the function. Here, there are three ways to change the discussion.
1, directly modify the function declaration when the formal parameters
Copy Code code as
Copy Code code as follows:
Year of birth Birth Month Please select a month January February March April May June July August September October November December Day Constellation: Zodiac:"
Copy Code code as follows:
reading XML and Paging
In the process of writing, involving the processing of code, because I initially, the JavaScript code in the head tag, resulting in the Document.body object is empty!
We all
Recently the most online saw a person interview Taobao experience, and then found himself a lot of not very clear place, so I write some articles to deepen their understanding of some problems.
One of the questions mentioned in the article is: How
First, the causeThat day to Prototype.js opened to see, only to see a few lines on the full head fog, the reason is not very familiar with the object-oriented JS, so Baidu +google a handful, finally count small have harvest, write this commemorative
Copy Code code as follows:
Delay wait Effect of/*ajax submission * *
var ajaxloding = new Object ();
Wraperid: container element showing loding pictureMS: Indicates the length of time that the loding icon displays, millisecondsEnvent: An
Originally want to arttemplate source analysis of the comments put up to share, but after a year, can not find, had to analyze the template engine principles, their own try
Write down the template engine to share with you, leave a souvenir,
How JavaScript gets the specified object on the current page.
The method is as follows:
Copy Code code as follows:
document.getElementById (ID)//Get object with specified ID value
Document.getelementsbyname (name)//Get an array of
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.