JavaScript to get the site root address (URL)

/*** Get the root address of the website. If it is a virtual directory, it carries the virtual directory name * @ Param isvirtual or not * @ returns {string} */function getsiteroot (isvirtual) {var siteroot = Window. location. protocol + "//" +

Usage of null and undefined in JavaScript (in JSON)

Null and undefined in JavaScript are always bothering me. The following is a summary for query. In JSON, if you do not have this node, but you use a certain attribute of this node, an error will occur, but no error will be reported. The correct

Javascript sort table & merge Same Column

Note: Appendchild () My test results: 1 after all rows in the appendchild () Table move up one row cyclically, the last row of the table is replaced with the new row. This is equivalent to replacing the first row of the table, move one row up

Encode JavaScript code into gb2312 encoding function (urlencode)

  I didn't think it was before. Today I found that Asp.net will help us encode the data when passing parameters! It is also shameless that it cannot be canceled to Prevent Automatic decoding. For example, search. aspx? Key = China, will

Javascript reads and sets style attributes of document elements

First, let's talk about the style sheet attributes. 1. inline style is set in the element style attribute, with the highest level 2. The page style table definition is defined in the page , followed by the level 3. External link style table

) Javascript eval

1 Basic eval usage: The function receives a parameter S. If S is not a string, S is directly returned. Otherwise, execute the s statement. If the execution result of the s statement is a value, this value is returned; otherwise, undefined is

Explore the execution sequence of functions in Javascript

The first test code is as follows:Test code 1:   The code is simple. Two functions with the same name, myfn, are defined and called in different places, but the execution result is unexpected,Both outputs are FN2, instead of the first fn1 output

Zhang xiaoxuan, JavaScript lecture notes 4

1. Comparison of global variables and local variables   2. Functions with variable parameters in Javascript Use the arguments object in the function to access all parameters passed by the calling program. In the function declaration, the function

Dom, JavaScript

 1. Javascript Basic concepts:Javascript is a client scripting language that is based on objects and events and is relatively secure. It is also a scripting language widely used in client web development. It is often used to add dynamic functions to

Add, delete, and modify pages using JavaScript

adduser.html Display some user interfaces Style = "border: 1px red solid; margin-bottom: 100px; padding: 10px 10%"> NameGenderEmailDate of birthOperation User name:Gender:MaleFemale Email:Date of birth:Onclick = "showcalendar (this, document.

Automatic loading of JavaScript pages

  Method 1: Window. onload = function (){ VaR name = Document. getelementbyid ("name"). Val (); // load HTML and all external reference files (images, CSS styles, JS, etc) }   Method 2: Introduce jquery's. JS File $ (Document). Ready (function

Javascript grammar learning notes-mouse and button operations

Javascript syntax learning notes: Mouse and button operations, compatible with IE and FF If you have any comments or suggestions, please submit them more. Bytes ----------------------------------------------------------------------------------------

Secure Web login using JavaScript

Currently, user logon on many commercial websites is carried out with clear codes. Generally, users are used to storing the same password for all accounts, even many people use the same password as their own bank accounts! Therefore, there are still

Javascript + ActiveX

It took three days to rewrite an MFC dialog base application into an ActiveX control. Because vs is powerful, it is very easy. You only need to copy all the cdialog code to ActiveX that supports MFC, and then add a cdialog variable to olecontrol.

A JavaScript code that changes the color of the last selected DataGrid

VaR supplier_lastselectrowid = ""; Function supplier_selectrow (sender) {If (supplier_lastselectrowid! = "") {Var lastselectrow = commandid Doc ument. getelementbyid (supplier_lastselectrowid); If (lastselectrow! = NULL) {lastselectrow.

Use JavaScript to implement web hotkeys

P ress p n ext one C lose window

Use JavaScript to instantly count the number of words in the input box

JS Code: Function checkcontentkeyup () { var content = document. getelementbyid ('content'); var length = content. value. length; var contentmsg = document. getelementbyid ('contentmsg '); contentmsg. innerhtml = "you have entered the " + Length

A small demo of JavaScript cookie reading and writing

test cookie cookie read/write test write COOKIE: & Lt; table width = "100%" & gt; User name: password: Read COOKIE:

40 common tips (JavaScript) for Web pages-[unexpected needs]

Tips → 40 common tips for web pages (JavaScript) Tips ------ [unexpected needs] 1. oncontextmenu = "window. event. returnvalue = false" will completely block the right mouse button NO 2. cancel selection to prevent Replication 3. onpaste =

40 common tips for web pages (JavaScript 2)

21. Make the pop-up window always on the top: 22. Do not use a scroll bar?Make the vertical bar not:Make the horizontal bar unavailable:Remove both of them? Simpler 23. How do I remove the dotted line around the image after clicking the image link?

Total Pages: 5378 1 .... 2744 2745 2746 2747 2748 .... 5378 Go to: GO

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.