1. Disable right-click and copyMethod 1:Add the following to the webpage:Code:Method 2:Add the following code to :OrIn essence, method 2 is the same as method 1.Method 3:If you only restrict replication, you can add the following code in :
2.
It can be seen from John resig's how JavaScript timers work that the existing JavaScript Engine processes tasks in a single thread. It puts the task into the queue and does not execute it synchronously. It must start another task after completing a
1. length limit
2. Only Chinese characters are allowed
3. English only
4. Only numbers are allowed.
5. Only English characters and numbers are allowed.
Onbeforepaste = "clipboardData. setdata ('text', clipboardData. getdata ('text').
This morning, JS scripts are always written with errors, but I guarantee that there is no problem with the lines prompted, because the line is , how can it go wrong! The error message is that the row has a missing object! Why? I decided it was
In the B/S Mode
ProgramJavaScript scripts are often used. The functions are very powerful, but debugging is very troublesome. Because there is no proper tool, ie supports script debugging for JavaScript, you only need to set the IE and script
It was not necessary in the project, but I think it would be better if we could drag the client, so we started to write a drag. In fact, there are a lot of source code available on the Internet, but I always want to write one by myself, because I
In JavaScript, anonymous functions can be automatically executed, but the passing of parameters is worth noting. Generally, there are two forms:
1. Write parameters directly after the Function
(Function (a, B){Alert (a + "and" + B );}) ("A", "B");
JavaScript does not support real classes (such as Java, C #, C ++), but it can define pseudo classes through constructors and attributes.
Constructor: A constructor defines an object class and uses its parameters to initialize the attributes of the
ArticleDirectory
Syntax
Return Value
Description
Throw
Example 1
Example 2
Definition and usage
The eval () function can calculate a string and execute the JavascriptCode. Syntax
Eval (string)
Parameters
HTML Dom tutorial 8-JavaScript Object
JavaScript Object
Object
Description
Window
The top-level object in the Javascript level, indicating the browser window.
Navigator
Contains information
IsHtmlIt is very convenient to add a custom attribute to an element. You only need to add it to the angle brackets, which is equal to the built-in attribute.
If we wantTextboxAdd attribute to elementIdvalue:
Input
Type
= "Text"
ID
=
Get the content of an IFRAME in Javascript-crossbrowser solution for both IE and Firefox
Http://roneiv.wordpress.com/2008/01/18/get-the-content-of-an-iframe-in-javascript-crossbrowser-solution-for-both-ie-and-firefox/
OK, let's imagine
View code
1 Interface Htmlcollection 2 { 3 // Number of nodes included 4 Readonly Attribute unsigned Long Length; 5 // Returns the corresponding node based on the specified index. 6 // The nodes in
This is a summary of JavaScript. So far, I have written a lot of JavaScript experiences, many experiences, and many blog posts, maybe in the future, your blogs and those collected blogs are the places you often visit.
VaR STR = "liuyu"; var test =
ArticleDirectory
2. What are the functions and effects of closures?
Iii. microview of closures
Iv. application scenarios of closures
V. Garbage collection mechanism of JavaScript
Vi. Conclusion
Recently, I have read a lot
1. Javascript local printing
You can use style control to print the print. The style is as follows:
Then you can use the style:
No printing required
========================================================== ==========================
In the Javascript project development process, some short and precise functional functions can always solve some problems, or inspire developers to write more powerful programs. So here, I sort out some beautiful functions that I usually use or see
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