Js Regular Expression verification number, email address, delete Space// Function: Remove spaces before and after the string// Return value: the string with spaces removedFunction fnremovebrank (strsource){Return strsource. replace (/^ s */, '').
Function Xajax (){If (xajaxDebug) this. DebugMessage = function (text) {alert ("Xajax Debug: n" + text )};This. workId = ''xajaxwork'' + new Date (). getTime ();This. depth = 0;// Get the XMLHttpRequest ObjectThis. getRequestObject = function (){If (
$ Pinyins = Array ();// When the ishead of a Chinese character is 0, the first letter of the Chinese character is output when the ishead of all Chinese characters is 1.Function GetPinyin ($ str, $ ishead = 0, $ isclose = 1 ){Global $ pinyins;$ Restr
Case 1: The style is used when a few elements on the page are not printed (not previewed). The details are as follows:The style is defined as follows:@ Media print {. Notprint {Display: none;}}@ Media screen {. Notprint {Display: inline;Cursor: hand;
Function pattern (str ){// Str = str. replace (/(rn | n | r)/ig ,'');Str = str. replace (/] *>/ig, 'n ');Str = str. replace (//] */>/ig, 'n ');// Str = str. replace (/[code] (. + ?) [/Code]/ig, function ($1, $2) {return phpcode ($2 );});Str = str.
Js unlimited classification menu
:
The three files are composed of one, test.htm css.css js. js
The code of the test.html file is:
Untitled Page MSDN
I will not talk about it here, as long as it will be okay for html. If you don't
First, let's look at the effect of the following example: Principle:How to move the focus of the text box one by one with the "Enter key". Three methods are provided. The best one is as follows:Use a client script to add the onkeydown event
1. Performance Comparison
If the first operation Number of & is false, false is directly returned without considering the second operation number. If | the first operation number is true, and returns true directly without considering the second
Async attributes
The async attribute indicates whether asynchronous download is allowed.Basic syntax boolValue = XMLDocument. async; XMLDocument. async = boolValue;The Boolean value is writable (read/write). If asynchronous download is allowed, the
Many times we will see the text on the webpage, which can be edited as long as we click it. Next I will introduce a Summary of the javascript Mouse clicking text to text box code, for more information, see.
The Code is as follows:
Copy
This article uses several ultra-simple codes to implement title scrolling. For more information, see the reference.
The Code is as follows:
The Code is as follows:
Copy code
(Function (){Var titleScroll = function (){Var
This article introduces the tips for improving the readability of JavaScript code. Here we will introduce the methods. For more information, see.
Flattening Logic
In our work, we may encounter some complicated logic, such as: Meet condition 1, or XX;
In js, the most common code for converting arrays and strings is to use the join and split functions for operations. This is somewhat similar to array and character conversion in php and asp, next I will introduce the operation methods in js.
Method
This article will summarize the code for passing values between frameworks (iframe) in js, from our most commonly used method to my summary of writing a function and some of the following methods for transferring iframe cross-origin values.
Many
This article will collect some of the control form operation functions commonly used in front-end WEB development for your reference.
. Automatically select text when the mouse passes
Code:
Mouse Selection:
2. Set the radio button
Code:
js
This article introduces the src Method for matching images and all image addresses in js regular expressions. For more information, see.
Implementation: Use the js regular expression to match all images and all image addresses in src.
Idea: 1. Match
To implement countdown in js, we need to use the setTimeout function. setTimeout can be used to set the execution time or place the display time in the input, div, or other containers.
1. Simple timing pop-up window:
In this instance, we will create
Because today we want to build a website background and the background uses a framework, the results are always in the framework when exiting. Next I will introduce a method to jump out of the framework.
Core code
The Code is as follows:
This article will introduce the dijit. form. DateTextBox date automatic conversion method in js. I hope some methods will be helpful to you.
After investigation, we can use the following code to solve the problem.
The following code:
The
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