First build a page as follows: Here are two tables, the above one has data, the following one has no data, only a table head!
Copy Code code as follows:
1 I am a Chinese study hard
2" I am a Chinese study hard
3 I
Password strength prompts, such as Youku, are often visible when registering on some sites:
Today I did a JS password strength judgment, the effect is as follows:
Here's the code:
Copy Code code as follows:
js Judgment Password
Effect Chart:
HTML code:
Copy Code code as follows:
Table Same content merge
Before merging:
a
1
2
3
4
5
a
1
2
3
4
6
a
2
3
3
4
b
3
4
6
7
b
3
5
6
7
cc
2
3
4
JQuery.ligerDialog.confirm (' OK delete? ', function (confirm) {
if (confirm)
F_delete ();
});
======================================== "Center pop-up message Box"
Lg.showsuccess ("Update successful!") The current temporary charge will be emptied,
Looking at the LABJS source code, we find that there is a function to convert the relative address to an absolute address, and take it out as follows:
Copy Code code as follows:
function Canonical_uri (SRC, Base_path)
{
var
These two days in the Web front-end, encountered the requirements through JS to achieve the function of text replication.
Regardless of browser compatibility, look at the browser's support for replication features:
1, IE browser, the solution has
Let me guess the cards in your heart, first randomly generated 27 cards, you can not repeat the list of three cards, and then remember one, and then click on the list of cards, many times you can guess the cards you want.
If it is 9, just guess 2
I recently tuned NetSurf also encountered a related Bug:alert () was transferred two times. HTML code:
Copy Code code as follows:
alert onclick example
first line of Paragraph.
add another textnode.
Via
Small number of good, many words on a dense pile of text, exquisite artistic youth, will use a large number of character join symbols even with indentation, forced into several lines. For example:
Copy Code code as follows:
var html =
Students who have used Java and C # are very familiar with namespaces, in the complex system there will be more than n functions, objects, language provided, architecture predefined, so many functions and objects, because the programming
How does JavaScript get and set the height and width of the div and are compatible with any browser? Look at the code:
Copy Code code as follows:
http://www.itdos.com
http://www.itdos.com
Gets the width height of the div1:
Used JavaScript students are sure to prototype thunderclap piercing, but this is what it is a beginner mixed, only know that the function will have a prototype attribute, you can add a function for instance access, the other is not clear, recently
The following associative array is introduced first:
Copy Code code as follows:
Execute the above code, showing 1.
In JavaScript, methods and properties are treated as values.
Copy Code code as follows:
Implement the
There are many ways to create objects in JavaScript, so creating objects is a very flexible way to use them. So which is the most appropriate way to create an object? Construct pattern, prototype mode or object intent mode (objects literal)?
But
Sometimes we want to use JS to write a small program, but also feel that using the browser to run a lot of trouble, so now we look at how to use Java programs to invoke JavaScript programs, so you can not use the browser can execute JS code.
The
JavaScript language design is not rigorous, many places will be careless error.
For example, consider the following scenario.
Now, we want to determine whether a global object MyObj exists, and if not, declare it. The algorithms described in natural
Copy Code code as follows:
$ (). Ready (function () {
for (Var i=0;i/**
* This kind of writing is not professional, if in the cycle, will register 5 events, click After Alert5 times
*/
$ ("#aa"). Click (function () {
Alert
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.