Recently read JavaScript Advanced program design, a great harvest, the next few days to write reading notes. Prior to writing an AJAX preliminary understanding of the essay, which has a function to create XMLHttpRequest objects, browser
Method One: Direct use call
Front desk JS:
Copy Code code as follows:
Following method:
Copy Code code as follows:
public static string Behindmethod ()
{
Return "This is a backstage method";
}
First, let me make a statement that I spent 2 hours working on regular expressions before writing this article. Sad ~ sad ~ sad ~
Follow the general idea, first look at the other several interpolation ways: I am a string
Copy Code code as
This issue introduces some simple event handling:
1. Mouse click
Copy Code code as follows:
New Document
Click me
This is the div context that will pop up between the
Today, a project needs to determine the IE version number, and because JQuery 2.0 to remove the browser version number of the judge (it recommended feature detection), so I saw a foreigner wrote a piece of code:
Copy Code code as follows:
Dynamic change of the height of the IFRAME, to achieve the automatic extension of the IFRAME, the parent page is also automatic God shrink
Principle: When the IFRAME page is loaded, call the parent IFrame object and change its height
To achieve a
div layer Drag Effect diagram:
Realize:Css:
Copy Code code as follows:
Js:
Copy Code code as follows:
Html:
Copy Code code as follows:
div Layer Drag
China
United States
In an open modal window, if you want to use a modal window to accept the flow of a server, you usually need to hide an iframe; Then use the form of IFRAME.SRC to make the request; Sometimes, it is found that the server is unable to receive the flow
Copy Code code as follows:
text box remaining word tip (character size)
function textlimitchecksj (Thisarea, MaxLength, Spanid) {
var str = thisarea.value;
if (Getchrlen (str, maxLength) > MaxLength * 2) {
Thisarea.value = str.substring (0,
The first method is to use jquery implementation, the principle is to find the site in the external links, and then to add Target=_blank to the link "property is done, the code is as follows:
jquery opens in a new window
Copy Code code as
When making a page, if you want to do a link click Do not do anything, or respond to click and complete other things, you can set its properties href = "#", however, this will have a problem, that is, when the page has a scroll bar, click will
1. Create a DIV element:
JavaScript code
Copy Code code as follows:
2. Create the properties of the DIV:
JavaScript code
Copy Code code as follows:
3. Create a div style:
Copy Code code as follows:
Tree navigation Menu
+ Time Date class
+ Anywhere display clock
+ Countdown code generator
-Eight styles of time display
-All Chinese date display
+ page Navigation class
Copy Code code as follows:
javascript implementation Div Floating on top of the page and with a close button effect instance
suspended toolbar (floating layer) at the top of the Web page, click can be closed Oh
Don't talk much.
Let's look at two pieces of code:
Copy Code code as follows:
var elems = document.getElementsByTagName (' a ');
for (var i = 0; i
alert (i);
Elems[i].addeventlistener (' click ', Function (e) {
The answer comes from StackOverflow, open this webpage Http://jsbin.com/opuvas can, this webpage also is the answer person writes oneself.
Two-dimensional code is this URL. The page has statistical access, the author wants to know how many people
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