Sometimes we need to dynamically Add the select option. Below I will separate my work records for you. Here we include jquery and js implementation code.
Js version
The Code is as follows:
Copy code
// Create an optionVar
Both substr and substring are JS string truncation functions. The two functions are similar in usage, but they are different in many places. Next I will summarize the usage and differences between substr and substring.
The syntax of the two is as
In js, cookie operations are related to the storage and clearing time. We only need to set the cookie expiration time to control its storage, below I will summarize some tips for using cookies in js.
Create and store cookies
In this example, we will
Document. location this object contains information about the current URLLocation. host get port numberLocation. hostname set or get Host NameLocation. href set or get the whole URLLocation. port: set or obtain the port number of the URL.Location.
Today, I read an article about converting the XML format to the JSON format by David Walsh. It feels good and I simply reprinted it.
The following is the magic javascript code for converting XML to JSON:// Changes XML to JSONFunction xmlToJson (xml )
As the namespace changes, the following GM_getValue and GM_setValue cannot be called in unsafeWindow:
// Normal use
GM_setValue ('foo', true );
GM_etValue ('foo ');
// The value of GM cannot be accessed.
$ ("# BtnPost"). click (function (){
GM_
This is the JS Code based on the cookie. It is collected from the Internet and is not tested in multiple browsers. The webpage window in IE is only displayed once.
Usage:
1. Add the following code to the head section of the webpage.
2. Put the red
Introduction
In this article, we will discuss in more detail a common ECMAScript object-function. We will study in detail the various types of functions and explain how these types of functions affect a context variable object and what is included
Substr MethodReturns a substring of the specified length starting from the specified position.Stringvar. substr (start [, length])ParametersStringvarRequired. The String text or String object to extract the substring.StartRequired. The starting
This is a very simple application, which has been widely used to create foldable areas on webpages over the past few years. The basic idea is to use the display feature of CSS.
use JavaScript to implement code in the foldable area-LIEHUO. NET
(Www.bkjia.com) Tutorial JavaScript implementation click the prompt to close the web page window
Reference content is as follows:Function CloseWin (){Window. opener = null;Window. open ('', '_ self ');Window. close ();}Instance:XML/HTML
For the tutorial of helping customers (www.bkjia.com), you may have seen that the customized bar of IE can swap the data of two select boxes, and implement two Select interchange data on the webpage. Have you ever seen it? It is simple and practical,
The popular Ajax is not a new technology. It is just a combination of old technologies. You can see from its full name that Ajax is Asynchronous JavaScript and XML (and DHTML) that is, Asynchronous JavaScript and XML.
To understand how Ajax works,
Many websites require the client to do a lot of complex work. For example, the client JavaScript is used for Data Validity verification, which requires the client's browser's JavaScript enabled; Session variables are used to record identity and
Bkjia.com document DOM performance bottleneckThe bottleneck of DOM operations is screen re-painting. Reducing the number of redraws may increase the efficiency of DOM operations.
Reduce re-painting to improve efficiency concentrate DOM operations at
To do things well, you must first make good use of them. Well, because our time is short and we only have six days, then we will learn Mt in a hard-to-remember manner in six days, therefore, we need to learn from the Editplus material bar to help us
The types of Mootools mainly include the following parts: String; Number: Number; Array: Array; Object: Object; Json:; Cookie :.
This is also the focus of our speech today. each data type Mt has extended its own method, which can be seen through the
Tip 1: setTimeout.
Application Case: for example, if you want to execute a function ten times in a loop, what should you do? SetInterval and clearInterval are usually used in the past. Skill 1 is to overcome this problem.
(Function (){Var I =
I have read javascript call in the tutorial video. This method is very common in ExtJs.In the past, when ExtJs was involved, the initComponent code was always ignored, as shown below. Today, when reading other people's code, I found that the called
The status of the xmlHttpRequest object indicates the status of the current http request, which is a long integer data. Here we will introduce its meaning.Http Request status and its meaning1xx-Information prompt100-the initial request has been
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