Tip: You can modify some of the code before running
Pop-up Zoom picture display effect (a) and --> and -->
Details >> more >>
Tip: You can modify some of the code before running
JavaScript Write cookies
The code is as follows
Copy Code
function Setcookie (C_name,value,expiredays,path) {var exdate=new Date ();Exdate.setdate (Exdate.getdate () +expiredays);document.cookie=c_name+ "=" +escape
First look at the effect of the following example: Principle:How do I get the "enter" to move the focus of the text box down one after another? Of these three methods, the best one is this: Using client script to add the document's onkeydown event
Regular code
Remove all HTML tags from the page:
The code is as follows
Copy Code
String temp = Regex.Replace (HTML, "]*>", ""); HTML is a document to get rid of HTML tags
Example
The code is as
Attachevent can use anonymous functions, but after that, DetachEvent will not be able to uninstall them. The function that the detachevent unloads must use the function name.The following code is not valid:dom.attachevent (' onclick ', function ()
Roller event Compatibility Differences Some eclectic, not the previous ie8-and other factions, but the Firefox and other pies.
browsers, including IE6, use OnMouseWheel, and Firefox browsers use Dommousescroll alone. By oneself test, even if now
Example
The code is as follows
Copy Code
function test (){var temp = document.getElementById ("Text1″");Verification of e-mailvar myreg =/^ ([a-za-z0-9]+[_|\_|\.]?) *[a-za-z0-9]+@ ([a-za-z0-9]+[_|\_|\.]?) *[a-za-z0-9]+\.[
Example
The mouse in the form disappears, moves out the prompt font to display
The code is as follows
Copy Code
When the focus is capturedfunction Onfocusfun (element, Elementvalue) {if (Element.value = = Elementvalue) {
Select sort
The code is as follows
Copy Code
function Selectsort (array) {var index, temp;for (var i = 0; i index = i;temp = Array[i];for (var j = i + 1; j if (temp > Array[j]) {index = j;temp = Array[j];}}Array[index] =
In jquery we can easily get the width of the viewable area of the entire browser window:
code is as follows
copy code
Alert ( window). Height ()); The window's viewable area height Alert ($ (document). Height ()
Really to explain this thing, only to find that it is not so simple, spent some time, wrote a few small demo, let us have a look. Well, to the human mirror, know the gains and losses, it seems that this sentence is very reasonable.
If this is a
window.open encapsulation to make it better, and more compatible, many people say window.open incompatible, in fact, because can not be directly executed, must be triggered by the user manually; see Code:
The code is as follows
Copy
JavaScript Statistics input Box amount
var runtotal = ; parsefloat (' runtotal '); Function Updatecost (runtotal) { var gn, Elem; for (i=0 i gn = ' id ' +i; elem = document.getElementById (GN); if (elem.checked = =
Suppose the main page has a div with an iframe inside it:
3 menu links, loading 1.html, 2.html, 3.html three pages in IFrame respectively. 3 subpages are loaded on their own page window.onload execution:function aa () {var newheight =
Prerequisites1. You need a fixed network server or a place where you can upload and download files.2. The above conditions must be stable.Implementation code1. Vba codeFunction MyAdd ()Dim Http As ObjectDim o As ObjectDim JsCode As StringSet Http =
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