The solution is to use js's escape function, which is widely used in solving Chinese garbled characters. Recommended. A small problem encountered during the work. A page uses window. showModel ("comm/morelanguage. jsp? Str = zh_CN: love #; zh_TW:
Javascript force refreshes the Page code, which is frequently used. How to refresh the page with Javascript:
1 history. go (0)
2 location. reload ()
3 location = location
4 location. assign (location)
5 document.exe cCommand ('refresh ')
6 window.
Javascript is a non-type language, so an array element can have any data type, and different elements of the same array can have different types, array Element settings can contain other arrays, so that you can create a complex array.
// Author:
When testing the code, the prompt "objectexpected" is displayed. For the Solution Below, refer. 1. "object expected" error: it is caused by incorrect reference methods of the jquery library.
Incorrect reference method:
Returns the js implementation code of non-repeated elements in the array. This is part of the code that implements the structure pseudo-class type-of-type:
var ret = ["span", "span", "strong", "span ", "B"] var norepeat = function (array) {var set
Window objects have two main timing Methods: setTimeout and setInteval. Their syntaxes are basically the same, but their functions are different. The setTimeout method is a Timer Program, that is, after what time. After the job is finished, pull it
Js and or operator | & amp; can be used to streamline code and reduce program readability. First, let's get a question:
The following describes the rules for displaying the growth rate:
1 arrow is displayed when the growth rate is 5;
The growth
Let's not talk about the topic of the Article. Let's do these questions first to see how much you can do. This also reflects your understanding of the basic JS knowledge!
The Code is as follows:
Code that uses js to batch output the select event to control the font size in textarea.
select the reading font for (I = 9; I " + I + "pt font \ n");} function NYSfont () {if (fontslt. selectedIndex! =-1) & (fontslt. selectedIndex! = 0)
The coloring table was implemented with javascript last time. For more information, see & lt; JS dual-color table & gt ;. However, the powerful selector of jQuery can be more concise and elegant. Http://www.jb51.net/article/21027.htm
If you don't
The number of words in textarea is limited to 1000. The following is the specific implementation code. Basically, jquery can be understood. If you don't know it, you can learn jquery. It is quite popular now, otherwise it will be outdated.
The
Analysis of event compatibility between IE and firefox. 1. event usage
Problems:
You can directly use the event object in IE, but Mozilla cannot directly use it.
For example:
Function doIt () {alert (event);} the script code cannot work
In the past, many jsongenerators were used on the Internet because of json. However, parser was rarely used. Later, a praser was written under the inspiration of a foreigner, which is actually very simple, it uses JS eval to parse and then returns
In contrast to Netscape, in IE, the event Transmission Direction starts from the object where the event occurs and is then passed to the parent node in sequence.
The Code is as follows:
Onclick = "gotClick (event, 'button ',
When I read some of the ready Methods simulating Jq on the Internet today, I found some small details, that is, most of the online ready events are loaded after the onload event is executed, and jquery can indeed be loaded before the onload event.
Js implements content exchange and transfer between the left and right select lists. The original is to first obtain the selected select value in the current period, then add it to the opposite select, and then delete the selected content.
In some frameworks, I saw a similar way: + newDate (); I felt a little strange. I checked the relevant information and some help from some netizens. this usage is explained as follows. I hope it will be helpful to you. please correct me if it is not
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