Well, come in for development. When there are too many webpages, you need a button to quickly return to the top, instead of rolling the pulley by yourself ~It was originally difficult to say that the above header should be implemented in Javascript,
If you press enter in a text box to let him execute a js function but don't want to submit the form, you can do this:
Function ysearch () // reload DataWindow{ValidateInputText ('yyyy'); // The first js function to be implementedIf (event. keyCode =
1. Text Box
1.1
Use var t = document. getElementById ("test"). value to assign the value to variable t,
1.2 of course, you can also assign the known variable value to the text box, for example:
Var m = "5 ";Document. getElementById ("test"). value =
Display can usually be set to none, inline, blockVisibility can usually be set to hidden or visible.When display is none and visibility is hidden, the elements will not be seen. However, there are differences.Display will hide the element, and the
Accessing a DOM element is costly. modifying a DOM element is more expensive because it causes the browser to recalculate the page's geometric changes.Of course, the worst case is to access and modify elements in a loop, especially for loop
1. Read the XML string:For example:Copy codeThe Code is as follows:$ (Document). ready (function (){
Var xml = " liubl chencp ";// Var xml = " 100 "; // You can also directly identify a Table.Var obj = $ (xml). find ("record ");});Note:
In Javascript scripts, the parameter reference principle is that the referenced parameter can be modified internally (such as attribute), but the reference corresponding to the parameter cannot be modified.A test example is as follows:Copy codeThe
To achieve this effect, select Add to right, add all to right, select Delete to left, and delete all to left.
Html section:Copy codeThe Code is as follows: option 1 option 2 option 3 option 4 option 5 option 6 option 7 select add to right>
Implementation of provinces and cities:
Select a province to determine the city content.
Jsp code:Copy codeThe Code is as follows:Province -- select -- Fujian Beijing Shandong Shanghai Counties and cities -- select -- Js Code:Copy codeThe
Maybe you have been using array sort in javascript.Maybe you always believe it will give you the correct results.At least I thought so too. One day, I saw the following code:Copy codeThe Code is as follows:[5, 10, 1]. sort (); The results may be a
Copy codeThe Code is as follows:/*Cookie ToolUsage:// Save ValueVar value = "7 days ";Tools. cookie ("day", value, {expires: 7}); // Save the string "7 days" with the key "day" to the cookie for 5 days// ValueVar v = tools. cookie ("day"); // use
Basic knowledge about upload controls:
The upload control () is used to browse and upload files on the client. The path selected by the user can be obtained by the value attribute, but the value attribute is read-only, the value cannot be assigned
Window. showModalDialog () usage:
Var returnValue = window. showModalDialog (url [, arguments] [, features]);
Url --Required parameter; Type: String, used to specify the URL of the document to be displayed in the dialog box
Arguments --Optional
I will post the code I demonstrated here, hoping to inspire all my friends who are using it. Here I use two examples to implement it.
.focus-item ul li.item{ text-align: center;}.scroll-area .prev,.scroll-area .next{ position: absolute; bottom: 59
I recently learned how to use easyui and found that the framework is easy to use and concise. I can make it easy to get this framework ....
Today, this application can be said to be speechless to me. I can understand the source code at a glance,
In extjs, you sometimes need to select a date range and automatically determine that the selected start date cannot be greater than the end date, or the end date cannot be smaller than the start date. The implementation code is as follows:
:As you
JS get current date and time
Var date = new Date (); date. getYear (); // obtain the current year (2 digits) date. getFullYear (); // obtain the complete year (4 bits, 2014) date. getMonth (); // obtain the current month (0-11, 0 represents January)
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.