Definition and usage the eval () function computes a string and executes the JavaScript code in it.
The syntax eval (string) argument describes string as required. The string to evaluate, which contains the JAVASCRIPT expression to evaluate or the
To start with setattribute, we often need to add various properties to the element dynamically in JavaScript, which can be done by using setattribute (), which involves browser compatibility issues.
The code is as follows
Copy Code
This two days to encounter the operation of the URL js, online Search A lot of methods, are direct operation, use is very inconvenient, there are many duplicate code.
So set hundred home strict, summed up the various methods, it compressed into a
The Replace (Regexp,replacement) method has two parameters, the first parameter can be a plain text string or a RegExp object, see the use of RegExp objects, and the second argument is a string or a function.
Here are some examples of JS string
I'll point out some important rules in this article about how you can use your JavaScript, what tools you use, and what benefits you'll get from it.
Make sure your code is as concise as possible
Don't rely on javascript for everything. Do not
We know that the direct use of Window.close () is a shutdown prompt, the user experience is compromised,
Solving method
When the child window calls Window.close (), the dialog box will not pop up, so as long as the window is set to a pseudo parent
E has a little-known function called conditional compilation (conditional compilation). Since the IE4 began to support conditional compilation, this feature has gradually gained more attention and is used in its own JavaScript code, even in some
Popular PracticeThe common practice now is to change the value by using the Onfocus/onblur event of the form element, as follows:
The code is as follows
Copy Code
Most of jquery's Watermark Plug-ins
This effect is modeled after the Chirs Coyier's parallax tutorial, which has been used by the Chirs to allow the use of the starry background.
Operation Effect:Watch here:http://www.fofronline.com/experiments/parallax/The effect can be previewed in
Until one day, I started piecing together Dom tags in js, and I needed to keep piecing together, and I found that my code was getting ugly, not only about the simplicity of the code, but sometimes the performance problems. Over the longer term, in
The Math object is different from the above object, it can be said to be a public mathematics class, there are many mathematical methods, for various mathematical operationsHowever, the math object does not need to be constructed, and you can use
Today, we discuss how to implement data encapsulation (encapsulation) in JavaScript scripts.
The simple point of data encapsulation is to hide the content that you do not want the caller to see. It is the first of three elements of object-oriented
The examples in this article describe the basic data types in JavaScript and several methods of type detection. Share to everyone for your reference, specific as follows:
There are 6 basic data types in 1.JS, and all operations in JS are based on
In search engine robot searches, the type,text/html for such "text" is the highest (except at this stage Text/xml), and text/javascript this kind of friendly degree is not ideal, If robot also wants to judge the DHTML code, the complexity is higher
No matter what knowledge to learn, the habit of learning their own knowledge into a list, will help us to clarify ideas, is a good learning method. Highly recommended.
The following length is a little long and I hope the reader will read it
Latest Animated Tutorials + CD-ROM-0 basics JavaScript
From the Internet to find good resources, machinery industry press the latest programming introductory book CD-ROM and animation tutorials.
Electric Donkey Download Address:
There has recently been a blackmail program called RAA, written entirely in JavaScript, that can lock a user's files by using a strong encryption program.
Most malware in Windows is written in a compiled language such as C or C + +, and is
Embed multimedia content into webpages, and embed multimedia into webpages
Chapter 4 embed multimedia content into webpages
Currently, when creating a webpage, you can not only place text and images on the webpage, but also embed audio, video,
How to introduce Baidu search engine and Baidu search engine on your website
It must be cool to call powerful search engines such as google and Baidu on your own pages. There are actually some searched engines. Below is a code segment that calls
JS fill in the bank card number every four digits with a space, js bank card
1. Native js writing
!function () { document.getElementById('bankCard').onkeyup = function (event) { var v = this.value; if(/\S{5}/.test(v)){ this.value =
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.