Whether it's a company employee or an external employeeProgramMembers and friends, most people do not know much about the advanced applications of JavaScript. In the existing knowledge architecture, JavaScript is considered to be only a
The following declaration is available in an HTML file:
BodyScroll= "No"Onkeydown= "Keydown (event )">Function keydown (event) {If (event. keycode = 13) {event. returnvalue = false; // the return value of the event is false, that is, the event is
EXT contains several methods starting with get. These methods can be used to obtain the DOM in the document, obtain the components in the current document, and obtain the ext element. Pay attention to the difference in usage.
1. Get MethodThe
Sets or obtains the specified file name or path of an object.
Alert (window. Location. pathname)
Set or retrieve the entire URL as a string.
Alert (window. Location. href );
Set or obtain the port number associated with the URL.
Alert (window.
XPath introduction Each XPath expression has two parts: one context node and one node mode. The former provides the starting position of the node mode. The latter is a string composed of one or more node selectors. for example, we use an
Event attributes and methods:
1. Type: event type, such as click in onlick;
2. srcelement: The Event source, which is the element of the event;
3. button: Declares the mouse key to be pressed. An integer. 1 indicates the left button, 2
Note: The element name attribute on the page and the name referenced by JavaScript must be case-sensitive.
Otherwise, you will be prompted with an error message "the referenced element is null or not an object"
---------------------------------------
1. ArrayObject shift () method
Definition and usageShift () is used to delete the first element of the array from it and return the value of the first element.
SyntaxArrayObject. shift ()
Return ValueThe value of the first element in the
Javascript page refreshing and pop-up window troubleshooting
1. No prompt to refresh the webpage
Have you found that when refreshing some webpages, a prompt window will pop up and click "OK" to refresh the page.
Some pages do not prompt. If the
I. Iframe
//&&&&&&&&&&&&&&&&&&&&Public method start &&&&&&&&&&&&&&&
// Obtain the Child Window value from the parent object
// ObjectID indicates the window identifier and ContentID indicates the element ID.
Function GetValue (ObjectID,
Document directory
Function STSScriptEncode (str)
Function STSScriptEncodeWithQuote (str)
Function STSHtmlEncode (str)
Function STSNavigate (url)
Function STSPageUrlValidation (url)
Function GetUrlKeyValue (kenName, bNoDecode, url)
Function
This article introduces several programming examples of Javascript. This includes testing browser calls to the home page, how to use Java Script to mark the modification time, and how to automatically display banner with JavaScript.
1. Use
Many customers like to raise these demands! In fact, implementation is not difficult! The Code is as follows:
I read ASP of MS some time ago. NET lectures, where I talked about how to move the focus of the text box one by one with the "Enter key.
/*** Title: check email pattern Code* Time: 2006-11-24* Author: colinmok*/
Function chkSendEmail (){// Check whether it is emptyIf (frmSendEmail. to. value = ""){Alert ("Enter 1 to 10 emails! ");Document. frmSendEmail. to. focus ();Return false;}If (
Formatting and outputting numbers is a very meaningful thing. For example, in many cases, we want a number to be output as a string in the specified format. For example, we may want it to retain two decimal places, that is, the result is 25.99, or
# Region dynamically generates JS files
Protected void BT_CreateJS_Click (object sender, EventArgs e)
{
// Define character Variables
String Dic_Title = "";
// Obtain the data source
DataSet ds = new DataSet ();
// Obtain the data list of all
During asp.net development, LinkButton may be often used, and the control will eventually be parsed as a hyperlink on the client;
In some cases, you may want to directly control the availability and non-availability of such buttons (that is,
// Class definition
// Method 1: General class definition method
Function player1 (_ name)
{
This. name = _ name;
This. say = function () {alert (this. name );};
}
Var p1 = new player1 ('llinzzi1 ');
P1.say ();
// Method 2: prototype definition
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