BelowCodeFavorite Homepage
Add your site to favorites
JavaScript code. This code is compatible with IE and Firefox:
// Add the website code to favoritesFunction favsite (){// WebsiteUrl = 'HTTP: // www.stl.com /';// Website nameTitle =
1. Fatal string
Javascrip string, similar to. Net string, large string operation fee CPU, and memory fee.
Replacement method: array, but you should first avoid various operations on large strings.
2. unwise dom
Repeated innerhtml Operations &
Code
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> // JavaScript document // The browser window moves horizontally x pixel vertical Y pixel at the current position Window. moveBy (x, y );
Use JavaScript to disable the previous page from returning backCode:Sometimes, when you click the next button, the page jumps to the next page. To prevent the user from returning to the previous page, use the following method:On the page to jump to,
From: http://javascript.gakaa.com/default.aspx
Every Scriptable Element Object in modern browsers is, at its core, a descendant of the Basic Htmlelement Abstract object in the W3C Dom. Htmlelement , Itself, inherits properties and methods from
There is a call and apply method in Javascript, which basically works the same, but also has a slight difference.
Let's take a look at the call explanation in the JS manual:Call Method
Call a method of one object to replace the current object with
// Obtain the coordinates
Function getpos (e ){
VaR T = E. offsettop;
VaR L = E. offsetleft;
VaR Height = E. offsetheight;
While (E = E. offsetparent ){
T + = E. offsettop;
L + = E. offsetleft;
}
}
Assume that obj is an HTML control.OBJ.
1. Javascript variable type
Javascript variables are classified into basic types and reference types. the basic data type is a simple data segment that directly has a stack space. This type directly stores the value at a location in the memory. the
There are two methods to define functions in javascript:
1. Common Function Definition:
function f1 (){}
2. Variable Function Definition:
var f2 = function(){}
Another way to define a function is new function. Since this method is not commonly used,
Function check (ID ){VaR Re =/^ [0-9] + .? [0-9] * $/; // determines whether a number is a valid regular expression.VaR danjia = Document. getelementbyid ('danjia '+ id). value; // obtain the value of the unit price text box.VaR shuliang = Document.
Javascript setdate () method http://www.w3school.com.cn/js/jsref_setDate.asp
Javascript date object reference manualDefinition and usage
The setdate () method is used to set a day of a month.Syntax
dateObject.setDate(day)
Parameters
Javascript itself provides some operations that can be used to process arrays, such as sorting, linking, and stacks. The following is a brief introduction.
1, Concat (arrayname2, arrayname3 ,..., Arraynamen) to connect the array itself with one or
2)If you need to refresh an IFRAME, replace the window with the frame name or ID.3)4>
Function ABC (){Window. Location. href = "/blog/window. Location. href ";SetTimeout ("ABC ()", 10000 );}
Refresh this page:Response. Write (" ")
Refresh the
This isAs days pass by, by Stuart LANGRIDGE
. Here I write about into things. in the past I wrote about other things but the past is past. I write code for people to play with, I write about my life on Twitter, and I write here.
On
Jul 03,200 9
[Img] http://www.blogcn.com/User12/antsam/Upload/20041217142710.jpg [/img]
This is a relationship between the four important components of javascript:Runtime, script, context, and Object
Note that objects can be shared between different
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