Javascript code used to obtain the page height and the position of the scroll bar

Copy codeThe Code is as follows:Var Viewport = {Top: function (){Return window. pageYOffset| Document.doc umentElement & document.doc umentElement. scrollTop| Document. body. scrollTop;},Height: function (){Return window. innerHeight| Document.doc

& Amp; and | in Javascript

In general, & | is relatively simple. We will not discuss it here.Prepare two objects for the following discussion.Copy codeThe Code is as follows:Var alice = {Name: "alice ",ToString: function (){Return this. name;}}Var smith = {Name: "smith

Faster than Jquery's document. ready Method

This is an article I saw in my blog last time. After testing, it is indeed more effective than jquery's $ (document ). ready (function (){....}) faster, and there is no problem with mainstream browsers such as ie and Firefox,I forgot who the

Comparison between IE and standard DOM in Javascript Event Events

1. Differences between event streams IE uses bubble events Netscape uses capture events DOM uses capture first and then bubble eventsExample:Copy codeThe Code is as follows: click here Bubble event model: button-> div-> body (IE event

Jquery-based image hover plug-in

Let's take a look at the usage.Demo address http://demo.jb51.net/js/jCutter_jquery/demo.htmWrite in the HTML file as follows:Copy codeThe Code is as follows:This is the content of the opened page. You need to write the code as follows:Copy codeThe

Summary of Solutions to incompatibility between JavaScript on IE and Firefox

1. compatible with firefox's outerHTML and FF, there is no outerHtml method.Copy codeThe Code is as follows:If (window. HTMLElement ){HTMLElement. prototype. _ defineSetter _ ("outerHTML", function (sHTML ){Var r = this. ownerDocument. createRange ()

Easily learn JS debugging (no tool is downloaded)

However, I still have some experience in JS debugging:First, when we write a piece of JS Code:1. Click IE browser-toolbar-click developer tools or press F12Our debugging InterfaceClick the leftmost part to set a breakpoint like VS2005. Click Debug:

Comparison and test code of efficient string assembly methods in JS

When Using Ajax to submit information, I may often need to assemble some large strings to complete POST submission through XmlHttp. Although the process of submitting such large information does not seem elegant, sometimes we may have to face such a

Function Code for converting Javascript Arabic numerals into Chinese uppercase digits

Main function code:Copy codeThe Code is as follows:Function Chinese (num){If (! /^ \ D * (\. \ d *)? $/. Test (num )){Alert ("You did not enter a number. Please try again! ");Return false;}Var AA = new Array ("zero", "one", "two", "three", "Si", "Wu"

JS non-Image Dynamic loading effect implementation code

The Code is as follows:First, the js object LoadingMsg that implements this function:Copy codeThe Code is as follows:Var Class = {Create: function (){Return function () {this. init. apply (this, arguments );}}}Var LoadingMsg = Class. create

Array. prototype. silce. call comprehension Analysis

Array. prototype. slice. call (thisArg [, arg1 [, arg2 [,...])Member introduction: ArrayArray object Prototype[Property]Is the property of an object in javascript. It is used to return the prototype reference of the object. You can dynamically add

Code for the menu effect of the javascript unlimited Linkage

Selects 2-level linkage 3-level linkage 4-level linkage 5-level linkage [Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]

Summary of basic javascript dom operations

You may often encounter this problem as follows:1. Create dom elements2. dom element insertion3. dom element replacement4. Delete dom elementsFirst, there are some simple dom elements on the page. aaaaaaaa bbbbbbbbbb ccccccccc Next we will create

Javascript URL encoding and decoding instructions

In some transfer pages, GB2312 is used, and UTF8 is used on the receiving page. In this way, the received parameters may be different from the original ones. The URL encoded using the urlEncode function on the server is different from the URL

When getting the focus, use the js timer to set the time to execute the action

Go to the topic and talk about the timer first. There are two dedicated timer functions in javascrui:1. Countdown timer: timename = setTimeout ("function ();", delaytime );2. Cyclic Timer: timename = setInterval ("function ();", delaytime );The

Practical code of the jquery page selection box

Copy codeThe Code is as follows: select all demo Select all ah me ELE. Me

OffsetParent algorithm analysis

When calling the offsetParent attribute of Element A, the element must be returned according to the following algorithm.If any of the following conditions is true, null is returned and the algorithm is stopped.A is the root element.A is the body

How does Extjs set the automatic prompt in exlipse?

1. Choose Help> Software Updates> Find and Install...> Search for new features to install-> New remote site...Name: "Spket", Url: "http://www.spket.com/update/" Download complete restart Eclipse2. Window-> Preferences-> Spket-> JavaScript Profiles->

Analysis on how to obtain div data under js

Knowledge learned from this:Document. getelementbyid ("ddhdh"). innerHTML can obtain all the data in the div, including tags... But it is only used in IE and OPERA.Document. getelementbyid ("ddhdh"). innerTEXT can be used to obtain text data in the

Js asynchronous processing progress bar

1. First, the effect is as follows: 2. UsageCopy codeThe Code is as follows:Var loader = new Ajaxloader (this. _ ContentID, {Text: 'loading... ', Top: 50 });Loader. Show (); 3. Code List:Copy codeThe Code is as follows:/*Processing progress bar,

Total Pages: 5378 1 .... 4228 4229 4230 4231 4232 .... 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.