易截截图软件、单文件、免安装、纯绿色、仅160KB

使用javascript 查询特定的table中的内容

 页面中有一个table包含两列,数据由后台生成,行数不定:(如图)
原始数据:
现在通过javascript进行查询,效果如下三图:
开始查询
查询中......
查询得到的自后结果
JAVASCRIPT代码:
 
JS代码
<script language="javascript" tpe="text/javascript">
function searchMaterial()

    var strcellCode;
    var strcellName;
    var strtextCode=document.all.txtCode.value;
    strtextCode=strtextCode.toLowerCase();
    var strtextName=document.all.txtName.value;
    strtextName=strtextName.toLowerCase();
    
    for (i=1; i < document.all.oTable.rows.length; i++) 
    {
            strcellCode=document.all.oTable.rows(i).cells(0).innerText ;
            strcellName=document.all.oTable.rows(i).cells(1).innerText ;
            strcellCode=strcellCode.toLowerCase();
            strcellName=strcellName.toLowerCase();
            if( (strtextCode=="" || strcellCode.indexOf(strtextCode)>0)
                &&(strtextName=="" || strcellName.indexOf(strtextName)>0))
            
            {document.all.oTable.rows(i).style.display="";}
            else
        &


相关文档:

Javascript中最常用的55个经典技巧

 1. oncontextmenu="window.event.returnValue=false" 将彻底屏蔽鼠标右键
<table border oncontextmenu=return(false)><td>no</table> 可用于Table
2. <body onselectstart="return false"> 取消选取、防止复制
3. onpaste="return false" 不准粘贴
4. oncopy="return false;" oncut="re ......

开源Javascript图形库[转]

原:http://www.cnblogs.com/webgis8/articles/1516639.html
几个开源Javascript图形库

 因为Google Map项目的需要,最近一直在寻求相关的Javascript图形库,在尝试用Google Map
API提供的javascript接口绘图时发现其效果和效率都不太理想,同时也用过jsgraphics库,也不是很好.又在网上找到了下面几个.
mxGraph
......

Javascript继承之对象冒充法

例如:有三个类classX,classY,classZ
classZ分别继承classX和classY
于是就有下面的写法:
function ClassZ(){
this.newMethod=classX;
this.newMethod();
delete this.newMethod;
this.newMethod=classY;
this.newMethod();
delete this.newMethod;
}
这种写法存在一个弊端.。如果classX和classY有具有同名的属 ......

JavaScript中函数的传递

每次用Google的
 GEvent.addListener(marker, "click", function() {
                    marker.openInfoWindowHtml(num);
             &n ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号