JavaScript ÍÏ·ÅЧ¹û
Ò»¸ö¿ÉÍϷŵģʣÓЧ¹û;
var isIE = (document.all) ? true : false;
var $ = function (id) {
return "string" == typeof id ? document.getElementById(id) : id;
};
var Class = {
create: function() {
return function() { this.initialize.apply(this, arguments); }
}
}
var Extend = function(destination, source) {
for (var property in source) {
destination[property] = source[property];
}
}
var Bind = function(object, fun) {
return function() {
return fun.apply(object, arguments);
}
}
var BindAsEventListener = function(object, fun) {
return function(event) {
return fun.call(object, (event || window.event));
}
}
var CurrentStyle = function(element){
return element.currentStyle || document.defaultView.getComputedStyle(element, null);
}
function addEventHandler(oTarget, sEventType, fnHandler) {
if (oTarget.addEventListener) {
oTarget.addEventListener(sEventType, fnHandler, false);
} else if (oTarget.attachEvent) {
oTarget.attachEvent("on" + sEventType, fnHandler);
} else {
oTarget["on" + sEventType] = fnHandler;
}
};
function removeEventHandler(oTarget, sEventType, fnHandler) {
if (oTarget.removeEventListener) {
oTarget.removeEventListener(sEventType, fnHandler, false);
} else if (oTarget.detachEvent) {
oTarget.detachEvent("on" + sEventType, fnHandler);
} else {
oTarget["on" + sEventType] = null;
}
};
//ÍϷųÌÐò
var Drag = Class.create();
Drag.prototype = {
//ÍϷŶÔÏó
initialize: function(drag, options) {
this.Drag = $(drag);//ÍϷŶÔÏó
this._x = this._y = 0;//¼Ç¼Êó±êÏà¶ÔÍϷŶÔÏóµÄλÖÃ
this._marginLeft = this._marginTop = 0;//¼Ç¼margin
//ʼþ¶ÔÏó(ÓÃÓÚ°ó¶¨ÒƳýʼþ)
this._fM = BindAsEventListener(this, this.Move);
this._fS = Bind(this, this.Stop);
this.SetOptions(options);
this.Limit = !!this.options.Limit;
this.mxLeft = parseInt(this.options.mxLeft);
this.mxRight = parseInt(this.options.mxRight);
this.mxTop = parseInt(this.option
Ïà¹ØÎĵµ£º
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>ÑéÖ¤Êý×Ö×î¼òµ¥<a href="http://www.jb51.net/list/list_6_1.htm" tar ......
function isTrueName(s) { var patrn=/^[a-zA-Z]{1,30}$/; if (!patrn.exec(s)) return false return true } }} //УÑéÃÜÂ룺ֻÄÜÊäÈë6-20¸ö×Öĸ¡¢Êý×Ö¡¢Ï»®Ïß
function isPasswd(s)
{
var patrn=/^(\w){6,20}$/;
if (!patrn.exec(s)) return false
return true
}
//УÑéÆÕͨµç»°¡¢´«ÕæºÅÂ룺¿ÉÒÔ ......
ÔÎĵØÖ·£º http://www.w3school.com.cn/js/jsref_tofixed.asp
¶¨ÒåºÍÓ÷¨
toFixed() ·½·¨¿É°Ñ Number ËÄÉáÎåÈëΪָ¶¨Ð¡ÊýλÊýµÄÊý×Ö¡£
Óï·¨
NumberObject.toFixed(num)
²ÎÊýÃèÊö
num
±ØÐè¡£¹æ¶¨Ð¡ÊýµÄλÊý£¬ÊÇ 0 ~ 20 Ö®¼äµÄÖµ£¬°üÀ¨ 0 ºÍ 20£¬ÓÐЩʵÏÖ¿ÉÒÔÖ§³Ö¸ü´óµÄÊýÖµ·¶Î§¡£Èç¹ûÊ¡ÂÔÁ˸òÎÊý£¬½«Óà 0 ´úÌ ......
Ò»¡¢¸ÅÊö
×Ö·û´®ÔÚJavaScriptÖм¸ºõÎÞ´¦²»ÔÚ£¬ÔÚÄã´¦ÀíÓû§µÄÊäÈëÊý¾ÝµÄʱºò£¬ÔÚ¶ÁÈ¡»òÉèÖÃDOM¶ÔÏóµÄÊôÐÔʱ£¬ÔÚ²Ù×÷cookieʱ£¬µ±È»»¹Óиü¶à...¡£JavaScriptµÄºËÐIJ¿·ÖÌṩÁËÒ»×éÊôÐԺͷ½·¨ÓÃÓÚͨÓõÄ×Ö·û´®²Ù×÷£¬Èç·Ö¸î×Ö·û´®£¬¸Ä±ä×Ö·û´®µÄ´óСд£¬²Ù×÷×Ó×Ö·û´®µÈ¡£
µ±Ç°µÄ ......
×î½ü·¢ÏÖDOMDocument¶ÔÏóºÜÖØÒª,»¹ÓÐXMLHTTPÒ²ºÜÖØÒª
×¢Òâ´óСдһ¶¨²»ÄÜŪ´í.
ÊôÐÔ:
1Attributes ´æ´¢½ÚµãµÄÊôÐÔÁбí(Ö»¶Á)
2childNodes ´æ´¢½ÚµãµÄ×Ó½ÚµãÁбí(Ö»¶Á)
3dataType ·µ»Ø´Ë½ÚµãµÄÊý¾ÝÀàÐÍ
4Definition ÒÔDTD»òXMLģʽ¸ø³öµÄ½ÚµãµÄ¶¨Òå(Ö»¶Á)
5Doctype Ö¸¶¨ÎĵµÀàÐͽڵã( ......