The framework of the refresh has always been uncertain, now think of this problem, the solution is really quite a lot, here summed up the 7 ways to refresh the frame with JS, in any of the frames page to refresh the other frames page, or more
The JavaScript date is subtracted, and then the second date is obtained. In peacetime encounter time plus and minus the probability is relatively large, the following JS function can be completed a specified number of days minus a certain number of
IFRAME has a annoying problem, is not set the height of the case, the nested area will show a large blank, and sometimes set a height is not good, and later use JavaScript easy to solve the problem of IFRAME adaptive height, the following experience
The constructor property always points to the constructor that creates the current object. For example, the following example:
The code is as follows
Copy Code
Equivalent to var foo = new Array (1, 56, 34, 12);var arr = [
Read for a long time, finally arrived I think the actual combat part, the first is window.open, plainly is the pop-up window.In terms of the basics:
The code is as follows
Copy Code
Equivalent to window.open
The principle code is as follows
The code is as follows
Copy Code
The code above is to create a new window, and then put the characters in the specified container on the page to run.
Example
Make a variable meaningful:
1, the definition variable is variable declaration, similar to: Var str;
2, variable assignment is variable initialization, similar to str= "test";
These 2 steps can be one-step, that is, to define variables and assign
Sorted out two simple JavaScript manipulation cookies, all of which have three functions: setting cookies, querying cookies, and deleting cookies. The first is easy to understand, and the second one is easy to use. Native JS set cookies.
Set
The code is as follows
Copy Code
file head, not print out the content ... file head, not print out the content ... file head, not print out the content ... This is the content that is printed This is the content that is printed
When we need jquery in JavaScript and can't tell if it's loaded, you can automatically judge and load jquery in the following ways:
The code is as follows
Copy Code
function Getscript (URL, success) {var script =
JS Code//
1. Determine if there is a value= "Paravalue" Item in the Select optionfunction Jsselectisexititem (Objselect, Objitemvalue) {var isexit = false;for (var i = 0; i if (Objselect.options[i].value = = Objitemvalue) {Isexit =
The regular expressions provided in this article, which are used to validate the code for a leap year, were previously written for date validation, but unified, including all dates, now we specialize in providing a date validation program for a leap
javascript Limit the maximum number of characters entered in the text box
character number Test Max 20 characters.
Programme II
javascript Limit the maximum number of characters entered in the text box
character number
The Custom right-click menu (ContextMenu) and the suspended-layer tree are all the same in their implementations, adding nodes dynamically in the script, and then generating an absolute positioning layer, except that the right-click menu tree
The difference between event streams
IE uses a bubbling event Netscape uses the capture event DOM to use the first-captured bubble-type eventExample:Copy code code as follows: Click here
Bubble Type Event Model: Button->div->body (ie event flow)
The Script can be placed inside the head of an HTML page, or it can be placed inside the body. put the script in the body, when the browser meets
Merge Scripts because script downloads block page rendering, you should reduce the use
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