1, the problem background:
encountered a small display of customer department name (Pinyin) business in the project, is under the department name has the corresponding pinyin, and in the existing database does not have the corresponding field,
So, more and more portals are also starting to add ratings or voting functions, here are 9 excellent JavaScript implementations of the rating voting Plug-ins and teaching materials to facilitate your two times development and use.
JQuery Start
The diagram below is my idea of design
The following is the specific JS code
1, first define several custom functions
Code
Copy Code code as follows:
Determines whether an array
function IsArray (v)
{
Return v && typeof
From then on, I have done a lot of research on these methods and have used them on many occasions. In many tasks, they are proven to be very useful (especially with regard to the abstract DOM selector of the structure).1, Domelement.contains
The eval () function
JavaScript has a number of tips to make programming easier.
One of these is the eval () function, which can execute a string as a JavaScript expression.
As a small example:
Copy Code code as follows:
var
The success of JavaScript is a great relish, writing JavaScript code for Web pages is the basic skill of all web designers, and this interesting language contains many things that are not well known, even for years of JavaScript programmers who have
Why not textarea it?
1 not highlighted
The 2 Tab key is not available. --Press the TAB key to switch to the next control
3 No code formatting. -because you are accustomed to the eclipse environment, you can use CTRL+SHIFT+F to format the code.
The day before yesterday I made a piece of paper [a line of code easy to handle the express message function], At the same time the release of the V1.0beta version of the Quick Message function and source code, the reason is beta, is the feeling
Dom adding elements, using node properties
dom add elements, using node properties item 1
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]
First, Dom Basics
1. Nodes (node)
If there is a Fibonacci sequence to calculate:
Copy Code code as follows:
var Fibonacci = function (n) {
return N };
I'm afraid the number one big browser will collapse, because the operation of the function will have a lot
One, what is the prototype property of the object in JavaScript JavaScript, the prototype property of the object that is used to return the reference to the object type prototype. We use the prototype property to provide a set of basic functions
Relatively simple, for example: There is a region
Copy Code code as follows:
var Divpanel = document.getElementById ("Newbody");
var controlinfo= divpanel.childnodes;
for (var index = 0;index {
Divpanel.removechild (Controlinfo[
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]
The more straightforward test code is:
Alert (test ("ID number"));
After testing, the above JS verification is too strong, the input of the correct ID card,
1, simple form of encapsulation call
Copy Code code as follows:
var userName = function () {return "Jeff Wong"} ();
alert (userName);
The above code is really simple, we can gradually break down into the following wording:
If you really understand how JavaScript functions invoke work, then you can avoid the occurrence of some bugs;
Let's start by creating a simple function that will be used in the following article, which returns only the current value of this and two
Name
Whether free
Whether to support output multiple types
Gorgeous interface
Functionality of
Construction framework
Ejschart
No
Is
Is
On
No
Jschart
Personal free
Is
Is
By default, the generated page code might resemble the following code:
Copy Code code as follows:
IRERTranscript
We can pass different parameters to object objects, such as XAP package
In the use of JavaScript, Dom operation is the most common, with the development of Web front-end technology, we are more and more use JS to manipulate the DOM elements, such as through Ajax request to get the data, and then update the elements on
Start with the question:
function Base () {}var base = new Base ()
How many objects (object) are created by the above two lines of code?
To answer this question, first clarify the concept of object in JavaScript.
Objects
In JavaScript, almost
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