The operator priority in Javascript is a set of rules. This rule controls the order in which operators are executed when calculating expressions. Operators with higher priority are executed before operators with lower priority. For example,
# "Contains a location information
The default anchor is # top, that is, the top of the web page.
Javascript: void (0) only indicates a dead link.
This is why sometimes a long page browsing link is clearly # But the page jumps to the top
Javascript often verifies Chinese characters. Here we provide two examples:
Javascript
Code:
Copy codeThe Code is as follows :/**
* A simple example
*/
Function ischinese (temp ){
VaR Re =/[^ u4e00-u9fa5]/;
If (Re. Test (temp) return false;
Debugging JavaScript may be the most depressing thing in Web development. So here we will definitely look for some good tools to help you debug. Here are 10 browser-based JS online debugging tools we have selected. I hope you will like them! Online
Copy codeThe Code is as follows: // The obj parameter: The jquery object of the element of the selected text to be disabled
// Parameter enabled: true, optional; false, not selected
Function setSelectable (obj, enabled ){
If (enabled ){
Obj.
In javascript, each node in the document has
ParentNode -- parent node
FirstChild -- the first subnode
LastChild -- last subnode
Previussibling -- brother node next to the front
NextSibling-sibling node next
Five Related nodes. These nodes
Some time ago I wrote a tabs tab switch effect. Today I have made some expansion on the basis of the original one and added automatic carousel, which has become a result similar to image carousel.
Html code:
Copy codeThe Code is as follows:
Preface
Basically, all JS data types have these two methods, except null. They solve the javascript value calculation and display problems. Rewriting will increase the optimization of their calls.
Test Analysis
Let's take a look at the following
Throttle
Ignoring all calls within a certain period of time is suitable for use when the frequency is high and the processing is heavy.
Copy codeThe Code is as follows: var throttle = function (func, threshold, alt ){
Var last = Date. now
When you create a form page, you need to determine whether the two js objects are identical.
Here is the solution on stackoverflow. Record it here.
Copy codeThe Code is as follows: Object. prototype. equals = function (x)
{
Var p;
For (p in
The replace function accepts two parameters. The first parameter is a string or regular expression. The first parameter can also accept a string or a function.
First, if the first parameter is a string, we no longer need to say "I am a boy". replace
Interpreter mode (Interpreter): defines a syntax format, implements it through program interpretation and completes the corresponding task. In front-end programming scenarios, you can apply the interpreter mode to interpret the CSS selector for DOM
Recently, I was modifying the open-source Baidu map and wanted to split the code that was coupled in it. After dismantling, we found some pitfalls. If there is no logical problem, the effect does not appear. Then I thought it was wrong to write the
Object Creation:
When a Function object is created, the Function object generated by the Function constructor runs code similar to this:
Copy codeThe Code is as follows: this. prototype = {constructor: this };
Assume that function F F when
If the Microsoft Json serialization library is used, the date will be
Copy codeThe Code is as follows:/Date (1224043200000 )/
The effective method is
Mydate. replace (// Date \((.*?) \) \ // Gi, "new Date ($1 )");If you want to convert the format,
When you see this question, someone may ask, JavaScript represents the client, and Session represents the server (you don't know if you can understand it ).
First of all, I need to change the module code in the Session when I click a module during
The select tag in html is also the asp: DropDownList control in asp.net.
Javascript operations on them
I. Basic understanding
Copy codeThe Code is as follows: var e = document. getElementById ("selectId ");
E. options = new Option ("text", "value "
Cause: Responsible for the R & D of the company's development platform. to protect intellectual property rights, you must consider java encryption technology and js script encryption technology. In the current situation where java encryption is very
Online Demo
You can still remember the jquery. validationEngine plug-in that we have introduced. Using this plug-in, you can generate a powerful form verification function without having to write any line of js Code. Is it amazing? The introduction
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