10. Writing Methods of mootools. js
The latest version of mootools. JS is 1.2.3, Which is 1.2.0. Mootool is designed as a very compact, modular, and object-oriented JS library. The class is used for writing classes in mootool. The class is new
5. Define a class using constructor + prototype. The same constructor can define multiple types.
CopyCode The Code is as follows :/**
* $ Define write tool function 2
* @ Param {object} Constructor
* @ Param {object} prototype
*/
Function $ define (
Scrollheight: gets the scroll height of an object.
Scrollleft: sets or obtains the distance between the left-side border of the object and the leftmost end of the currently visible content in the window.
Scrolltop: sets or obtains the distance
Escape () method: The specified string is encoded using the ISO Latin character set. All space characters, punctuation marks, special characters, and other non-ASCII characters will be converted into character encoding in % XX format (XX equals to
Note: The implementation of jclass in this chapter refers to the practice of simple JavaScript inheritance.
First, let's review the examples described in Chapter 1:
Function person (name ){This. Name = Name;}Person. Prototype = {Getname:
Classical inheritance in JavaScript.
Crockford is Javascript development
Community The most well-known authority is the father of JSON, jslint, jsmin, and adsafe, and the author of javascript: the good parts.
Now, I am a senior JavaScript architect
CopyCode The Code is as follows: var $ d = document;
Function $ I (s) {return $ D. getelementbyid (s );}VaR _ JSC = {}_ JSC. Client = (function (){VaR T = {};VaR B = navigator. useragent. tolowercase ();T. isopera = (B. indexof ('Opera ')>-1)T.
8. Ext. js Writing MethodEXT core3.0 and ext. extend is used to define a class (of course it is more used to extend a class). Ext uses ext to define various controls in the framework, such as panel and MessageBox. extend method. Here we only use it
The following describes some syntax highlighting plug-ins implemented by pure JavaScript.
Http://www.webdesignbooth.com/9-useful-javascript-syntax-highlighting-scripts/.
1. syntaxhighlighterI believe that this plug-in is widely used. It supports
Click () object. Click () enables the object to be clicked.
Whether the closed object window has been closed; true/false
Cleartimeout (object) clears the set setTimeout object
Clearinterval (object) clears the set setinterval object
The confirm
ArticleDirectory
After entering the information, press enter to verify it! (The simplest !)
Note: ie6.0, ie7.0, ie8.0, and Firefox/3.0.11 are successfully tested.
Xmlns = "http://www.w3.org/1999/xhtml">
After entering the
1. Check the following section.Code
Copy codeThe Code is as follows:
2. PrinciplesMake full use of the options that can contain parameters in the address bar, and use scripts to get the parameter passing between pages, without the need for the
Let's take a look at this example!
CopyCode The Code is as follows:
jquerydemo: quanjiaonum
Convert Chinese numbers to Arabic numerals:
This is a mobile phone number judgment problem! In addition, please note that jquery is also used!
Copy codeThe Code is as follows :/**
* @ Author Supersha
* @ QQ: 770104121.
*/
Var cssQuery = {
// Parent: used to store the reference of the parent node of the current node
Parent: document,
Select: function (selectorStr ){
Var selectors =
Principle Analysis:
1. First, set the height or width for the container, such as ul, and set ul height to 40px; overflow: hidden;
2. After the height of the container is set, the content height exceeds 40px, and more than half of the content
1. Each node in the document has the attributes nodeName, nodeValue, and nodeType.
The node name of the nodeName text node is # text, and nodeName is a read-only attribute.
NodeValue 1 Element Node 2 attribute node 3 text node read-only
For example, if you enter Michael Jacob or Changsha or Hunan in the input box, Michael Jacob will make you choose. If you enter 18, Michael Jacob will appear at the same time.
The test data source is as follows:
Copy codeThe Code is as follows:
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