I want to achieve a similar effect, and found that there are spaces in the lamp. The effect is not beautiful, so I wrotePage codeCopy codeThe Code is as follows:Congratulations, 187 *** 5204 got RBMCongratulations, 137 *** 1372 got
Today, when Xie Liang talked to me about performance, he used attr to operate the custom attribute data-uid. I said it is good to use data because it is implemented by dataset, then he flipped through the jQuery source code and told me that I was
The previously written pages have been used for a long time, but some other parameters are also required in addition to passing pages during paging. In the previous operation, you must put the parameters in the hidden pages, it is troublesome to
Js method:Copy codeThe Code is as follows: The following is the jQuery method. You need to reference the jQuery file.Copy codeThe Code is as follows: Or its shorthandCopy codeThe Code is as follows:$ (Function (){Var userName = "xiaoming ";Alert
In the new version of jquery, the live () method has been deleted, so we will prompt that the function does not exist when calling. js reports an error.The solution is to use the on () function to replace,The original statement is: If you replace it
This example uses json data and concatenates ul and li.:1. Prepare json data:Copy codeThe Code is as follows:Var menuData = [{Id: 0, pid:-1, name: "order product", url: "", children :[{Id: 1, pid: 0, name: "computer accessories", url: "http://www.jb5
ASP. NET Server controls use this JS Code for sending back:Copy codeThe Code is as follows:Var theForm = document. forms ['form1'];If (! TheForm ){TheForm = document. form1;}Function _ doPostBack (eventTarget, eventArgument ){If (! TheForm. onsubmit
A typical yepnope. js instance:
yepnope({ test : Modernizr.geolocation, yep : 'normal.js', nope : ['polyfill.js', 'wrapper.js']});
This instance indicates that normal. js is loaded when Modernizr. geolocation is true. If it is false, polyfill. js
Add or delete events using attachEvent and detachEvent in IE browser. In other standard browsers, addEventListener and removeEventListener are used. The following encapsulates the addition and deletion of events. Check the Code directly!
/*** @
In today's project, we encountered the need to use javascript escape to encode Chinese characters and then use unescape to decode the code segment.The details are as follows:First, use editplusto open the test page test.html and edit the following
When jquery is used to obtain the select statement, it is generally used as follows:
var selectedValue = $ ("# a"). val ();
In non-IE8, the value of selectedValue is "1", and the typeof selectedValue is "string ".
In IE8, the value of
$ (Document). height (): the height of the entire webpage$ (Window). height (): the height of the visible window in the browser$ (Window). scrollTop (): the height (vertical offset) between the top of the browser visual window and the top of the
Recently, a friend asked me how to print and preview Javascript. I will explain it today. First of all, I want to understand the printing principle. In fact, partial page printing is very simple. It is to make a starting mark for the part you want
Window. showModalDialog is the method of the pop-up mode window.
ReturnValue is the property of the html window object in javascript. It is used to return the window value. the showModalDialog function is used to open an IE mode window (the mode
Generally, loading all the necessary JavaScript code at one time will slow the initial page opening speed, but many loaded Code does not need to be used. This unnecessary performance waste should be avoided. To dynamically load JavaScript code, you
HTML pages need to be printed in recent projects. You need to specify the area for printing and use the jquery. PrintArea. js plug-in.
Usage:
$("div#printmain").printArea();
However, the content behind the DIV will still be printed. here we can use
Generally, the server should have different responses for different URL requests. We need to provide the request URL and other required GET and POST parameters for the route. Then the route needs to execute the corresponding code based on the data.
I have been using js recently. I have carefully studied the operations on js arrays. Here I will summarize them.
1. Create an arrayCopy codeThe Code is as follows:Var arrayObj = new Array (); // create an Array
Var arrayObj = new Array ([size]); //
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