javascript table²Ù×÷Àà
/************** javascript table²Ù×÷Àà***************
* ½öÊʺÏIE6
****µ÷ÓÃʾÀý*****************************************
*
* var table=new TableOption("tb");
*
* var table=new TableOptions("tb",{hoverColor:#aabbcc,hover:false});
*
*****************************************************/
var $=function(id){return document.getElementById(id);}
var Class={
create:function(){
return function(){
this.Init.apply(this,arguments);
}
}
}
var BindAsEventListener=function(fun,object){
return function(){
return object.apply(fun,arguments);
}
}
var AddEventHandler=function(obj,eventType,fun){
obj.attachEvent("on"+eventType,fun);
}
var RemoveEventHandler=function(obj,eventType,fun){
obj.detachEvent("on"+eventType,fun);
}
var Extend=function(source,options){
for(var key in source)
{
options[key]=source[key];
}
}
var TableOption=Class.create();
TableOption.prototype={
//³õʼ»¯
Init:function(obj,options){
this.Table=$(obj);
this.SetOptions(options);//ÉèÖòÎÊý
this.HoverColor=this.Options.hoverColor;
this.ActiveColor=this.Options.activeColor;
this.Hover=this.Options.hover;
this.Choose=this.Options.choose;
this.Multiple=this.Options.multiple;
this.OnClick=this.Options.onClick;
this.OnCancel=this.Options.onCancel;
this._AddMouseEvent(); //Ìí¼Óʼþ
this._CurrentRow=null; //µ±Ç°Òƶ¯ÐÐ
this.SelectedArray=new Array();//ÉèÖûò·µ»Ø±»Ñ¡ÖÐÐеļ¯ºÏ
},
//ÉèÖòÎÊý
SetOptions:function(options){
this.Options={
hoverColor:"#B5FFB5", //Òƶ¯Ê±±³¾°É«
activeColor:"#438ADA", //Ñ¡ÖÐʱ±³¾°É«
hover:true, //ÊÇ·ñ¿ªÆôÒƶ¯Ðб³¾°É«
choose:true, //ÊÇ·ñ¿ªÆôÑ¡Ôñ
multiple:true, //ÊÇ·ñ¿ªÆô¶àÑ¡,¿ªÆôºó°´Ctrl¿ÉÒÔ¶àÑ¡
Ïà¹ØÎĵµ£º
ECMA ±¾ÖÜÍƳöÁË JavaScript 5£¨PDF£©£¬³ýÁËÔöÇ¿»ù´¡º¯Êý¿âÖ®Í⣬»¹ÒýÈëÁËÑϸñÔËÐÐʱģʽ£¨Strict Runtime Modes£©ÒÔ±ÜÃâ´úÂëÖеij£¼û´íÎó¡£ECMA ECMAScript 4 µÄŬÁ¦ÔøÒÔʧ°Ü¸æÖÕ£¬ECMA ÉõÖÁûÓз¢²¼ ECMAScript 4 ϸÔò¡£
¹ýÈ¥¼¸Ä꣬ÖîÈç Nitro£¬TraceMonkey Ò»ÀàµÄ JavaScript ÒýÇ淢չѸÃÍ£¬JavaScript ³ÉÁË Google Wa ......
jsÑéÖ¤±íµ¥´óÈ«
1. ³¤¶ÈÏÞÖÆ
<script>
function test()
{
if(document.a.b.value.length>50)
{
alert("²»Äܳ¬¹ý50¸ö×Ö·û£¡");
document.a.b.focus();
return false;
}
}
</script>
<form name=a onsubmit="return test()">
<textarea name="b" cols="40" wrap="VIRTUAL" rows="6"&g ......
ÆðÒò£º
×Ô¶¨ÒåµÄÒ»¸öspiderÔÚץȡÀ´µÄÊý¾ÝÖУ¬Óи÷ʽ¸÷ÑùµÄÊý¾Ý´æ´¢±àÂ룬ÓÐЩ±àÂëÊÇ \uxxxx\uxxxx µÄ·½Ê½,Õâ¾ÍÉæ¼°µ½Ò»¸öunicodeµ½¿É¼û×Ö·ûµÄת»»£¬±ÈÈçת»»Îªgb2312£¬ÕâÑù²ÅÄÜ·½±ãÎÒÃÇÀ뿪ä¯ÀÀÆ÷ºóÒ²ÄÜÔĶÁ¡£
ÔÚÍøÉÏÕÒÁ˺ܶà´Î·½ÃæµÄ±àÂëת»»¶ÔÕÕ±í£¬²»¹ý¼¸ºõûÓÐÒ»¸öÍêÕû£¬ËùÒÔ×Ô¼ºÕûÀíÁËÒ»·Ý£¬Ï£Íû¶Ô´ó¼ÒÓаïÖú¡£Ëü°ü ......
javascriptÌṩÁËÐí¶àº¯Êý¹©¿ª·¢ÈËԱʹÓã¬ÏÂÃæ¸ø³öÒ»¸ö¼òµ¥½éÉÜ£¬¸üÏêϸµÄÐÅÏ¢Çë²Î¿¼Visual InterDevÌṩµÄÔÚÏß°ïÖú¡£
¡¡¡¡javascriptº¯ÊýÒ»¹²¿É·ÖΪÎåÀࣺ
¡¡¡¡·³£¹æº¯Êý
¡¡¡¡·Êý×麯Êý
¡¡¡¡·ÈÕÆÚº¯Êý
¡¡¡¡·Êýѧº¯Êý
¡¡¡¡·×Ö·û´®º¯Êý
¡ ......
<!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>ºáÏò²»¼ä¶Ï¹ö¶¯Í¼Æ¬</title>
<meta http- ......