客户端独立弹出详细的实现过程

拷贝粘贴以下代码段,保存为html文件,试试看效果如何吧。。。
前几天贴子没写东西就搁在上面搁了几天,真不好意思。


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
    
<HEAD>
    
</HEAD>
    
<body>
        
<form id="Form1">

<script language="javascript" type="text/javascript">
function PopupDetailBoard()
{
    
this.sContext="";
    
this.sTitle="";
    
this.AddTextLine=AddTextLine;
    
this.AddTitle=AddTitle;
    
function AddTextLine(title,context)
    
{
        
this.sContext=this.sContext+"<tr><td align=left width=30% valign=top><b><font face=arial>"+title+":</font></b></td><td width=70% valign=top><font face=arial>"+context+"</font></td></tr>";
    }

    
function AddTitle(context)
    
{
        
this.sTitle="<b>&nbsp;&nbsp;&nbsp;&nbsp;"+context+"</b>";
    }

    
this.ShowDetailBoard=ShowDetailBoard;
    
function ShowDetailBoard(Title,xpos,ypos,width,height)
    
{
        
var oPopup = window.createPopup();
        
var oPopBody = oPopup.document.body;
        oPopBody.style.backgroundColor 
= "white";
        oPopBody.style.boderTop
="solid buttonhighlight 2px";
        oPopBody.style.boderLeft
="solid buttonhighlight 2px";
        oPopBody.style.boderRight
="solid buttonshadow 2px";
        oPopBody.style.boderBottom
="solid buttonshadow 2px";
        
var headerHeight;
        headerHeight
=height/14;
        headerHeight
=parseInt(headerHeight);
        
this.sContext="<table width=100%>"+this.sContext+"</table>";
        oPopBody.innerHTML 
= "<table width=100% height=99% cellpadding=0 cellspacing=1><tr><td><table width=100% bgcolor=#d6d3ce border=1 height="+headerHeight+" style='border-collapse:collapse;border-top:1px solid buttonhighlight;border-left:1px solid buttonhighlight;border-right:1px solid buttonshadow;border-bottom:1px solid buttonshadow'><tr><td><font style='font-weight:bold;letter-spacing:2px;font-size:12pt;font-family:arial'>&nbsp;"+Title+"</font></td></tr></table><table width=100% height=92% border=1 bgcolor='white'style='border-collapse:collapse;border-top:1px solid buttonhighlight;border-left:1px solid buttonhighlight;border-right:1px solid buttonshadow;border-bottom:1px solid buttonshadow'><tr><td><div style='overflow:auto;background-color:#f7f3ef;font-size:10pt;width:100%;height:99%;border-bottom:1px solid buttonhighlight;border-right:1px solid buttonhighlight;border-left:1px solid buttonshadow;border-top:1px solid buttonshadow'>"+this.sTitle+this.sContext+"</div></td></tr></table></td></tr></table>";
        oPopup.show(xpos,ypos,width,height, document.body);
    }

}


function ShowDetail(Key)
{
    
var table=document.all('cacheTable')
    
if(table.rows.length==0return;
    
    pdb
=new PopupDetailBoard();
    
for(i=0;i<table.rows[0].cells.length;i++)
    
{
        
if(table.rows[0].cells[i].innerText=="序号")
        
{
            
for(j=1;j<table.rows.length;j++)
            
{
                
if(table.rows[j].cells[i].innerText==Key)
                
{
                    
for(k=0;k<table.rows[1].cells.length;k++)
                    
{
                        
if(table.rows[0].cells[k].innerText!='GloablRecordID')
                        
{
                            pdb.AddTextLine(table.rows[
0].cells[k].innerText,table.rows[j].cells[k].innerText)
                        }

                    }

                }

            }

            
break;
        }

    }

    pdb.ShowDetailBoard('您正在查看的信息是:',
300,400,500,500)
}


function ShowDetailEx(tableName,Key,title)
{
    
var table=document.all(tableName)
    
if(table.rows.length==0return;
    
    pdb
=new PopupDetailBoard();
    
for(i=0;i<table.rows[0].cells.length;i++)
    
{
        
if(table.rows[0].cells[i].innerText=="序号")
        
{
            
for(j=1;j<table.rows.length;j++)
            
{
                
if(table.rows[j].cells[i].innerText==Key)
                
{
                    
for(k=0;k<table.rows[1].cells.length;k++)
                    
{
                        
if(table.rows[0].cells[k].innerText!='GloablRecordID')
                        
{
                            pdb.AddTextLine(table.rows[
0].cells[k].innerText,table.rows[j].cells[k].innerText)
                        }

                    }

                }

            }

            
break;
        }

    }

    pdb.ShowDetailBoard(title,
300,400,500,500)
}

</script>
            
<TABLE id="cacheTable" style="DISPLAY: none; WIDTH: 928px; BORDER-COLLAPSE: collapse; HEIGHT: 1px"
                cellSpacing
="1" cellPadding="1" width="928" border="1">
                
<TR>
                    
<TD>序号</TD>
                    
<TD>公务号码</TD>
                    
<TD>应交移动话费</TD>
                    
<TD>应交长途话费</TD>
                    
<TD>减免移动话费</TD>
                    
<TD>减免长途话费</TD>
                    
<TD>其他数量</TD>
                    
<TD>其他现金</TD>
                    
<TD>补缴金额</TD>
                    
<TD>登记年月</TD>
                
</TR>
                
<tr><td>2</td><td>1000</td><td>1,000.00</td><td>1,000.00</td><td>1,000.00</td><td>1,000.00</td><td>1,000.00</td><td>1,000.00</td><td>1,000.00</td><td>2005年10月01日</td></tr><tr><td>3</td><td>10001</td><td>10,001.00</td><td>10,001.00</td><td>10,001.00</td><td>10,001.00</td><td>10,001.00</td><td>10,001.00</td><td>10,001.00</td><td>2005年10月31日</td></tr><tr><td>4</td><td>1000</td><td>1,000.10</td><td>1,000.00</td><td>10,001.00</td><td>1,000.01</td><td>1,000.10</td><td>1,000.01</td><td>1,000.01</td><td>2005年10月31日</td></tr><tr><td>7</td><td>11112121</td><td>11.00</td><td>11.00</td><td>11.00</td><td>11.00</td><td>111.00</td><td>11.00</td><td>1,111.00</td><td>2005年10月31日</td></tr><tr><td>8</td><td>111</td><td>11.00</td><td>11.00</td><td>11.00</td><td>11.00</td><td>111.00</td><td>11.00</td><td>1,111.00</td><td>2005年10月25日</td></tr><tr><td>10</td><td>1000</td><td>1,000.00</td><td>1,000.00</td><td>1,000.00</td><td>1,000.00</td><td>1,000.00</td><td>1,000.00</td><td>1,000.00</td><td>2005年10月31日</td></tr><tr><td>11</td><td>13170277520</td><td>200.00</td><td>200.00</td><td>20.00</td><td>100.00</td><td>50.00</td><td>150.00</td><td>18.00</td><td>2005年10月31日</td></tr><tr><td>13</td><td>100000</td><td>100,000.00</td><td>100,000.00</td><td>100,000.00</td><td>100,000.00</td><td>100,000.00</td><td>100,000.00</td><td>100,000.00</td><td>2005年11月02日</td></tr>
            
</TABLE>
            
<table cellspacing="0" cellpadding="0" rules="all" align="center" border="1" id="grid" style="width:100%;border-collapse:collapse;">
    
<tr align="Center" style="height:25px;">
        
<td>序号</td><td>公务号码</td><td>应交移动话费</td><td>应交长途话费</td><td>减免移动话费</td><td>减免长途话费</td><td>其他数量</td><td>其他现金</td><td>补缴金额</td><td>登记年月</td><td>查看详情</td>
    
</tr><tr class="tdbg" align="Center" style="height:23px;">
        
<td><href="javascript:ShowDetail('2');">2</a></td>
        
<td>1000</td><td>1,000.00</td><td>1,000.00</td><td>1,000.00</td><td>1,000.00</td><td>1,000.00</td><td>1,000.00</td><td>1,000.00</td><td>2005-10-01</td><td>
                            
<href="javascript:ShowDetail('2');">
                                查看详情
</a>
                        
</td>
    
</tr><tr class="tdbg" align="Center" style="height:23px;">
        
<td><href="javascript:ShowDetail('3');">3</a></td>
            
</td><td>10001</td><td>10,001.00</td><td>10,001.00</td><td>10,001.00</td><td>10,001.00</td><td>10,001.00</td><td>10,001.00</td><td>10,001.00</td><td>2005-10-31</td><td>
                            
<href="javascript:ShowDetail('3');">
                                查看详情
</a>
                        
</td>
    
</tr><tr class="tdbg" align="Center" style="height:23px;">
        
<td><href="javascript:ShowDetail('4');">4</a></td>
        
<td>1000</td><td>1,000.10</td><td>1,000.00</td><td>10,001.00</td><td>1,000.01</td><td>1,000.10</td><td>1,000.01</td><td>1,000.01</td><td>2005-10-31</td><td>
                            
<href="javascript:ShowDetail('4');">
                                查看详情
</a>
                        
</td>
    
</tr><tr class="tdbg" align="Center" style="height:23px;">
        
<td><href="javascript:ShowDetail('7')">7</a></td><td>11112121</td><td>11.00</td><td>11.00</td><td>11.00</td><td>11.00</td><td>111.00</td><td>11.00</td><td>1,111.00</td><td>2005-10-31</td><td>
                            
<href="javascript:ShowDetail('7');">
                                查看详情
</a>
                        
</td>
    
</tr><tr class="tdbg" align="Center" style="height:23px;">
        
<td><href="javascript:ShowDetail('8')">8</a></td><td>111</td><td>11.00</td><td>11.00</td><td>11.00</td><td>11.00</td><td>111.00</td><td>11.00</td><td>1,111.00</td><td>2005-10-25</td><td>
                            
<href="javascript:ShowDetail('8');">
                                查看详情
</a>
                        
</td>
    
</tr><tr class="tdbg" align="Center" style="height:23px;">
        
<td><href="javascript:ShowDetail('10')">10</a></td><td>1000</td><td>1,000.00</td><td>1,000.00</td><td>1,000.00</td><td>1,000.00</td><td>1,000.00</td><td>1,000.00</td><td>1,000.00</td><td>2005-10-31</td><td>
                            
<href="javascript:ShowDetail('10');">
                                查看详情
</a>
                        
</td>
    
</tr><tr class="tdbg" align="Center" style="height:23px;">
        
<td>
                            
<href="javascript:ShowDetail('11');">
                                11
</a>                        </td><td>13170277520</td><td>200.00</td><td>200.00</td><td>20.00</td><td>100.00</td><td>50.00</td><td>150.00</td><td>18.00</td><td>2005-10-31</td><td>
                            
<href="javascript:ShowDetail('11');">
                                查看详情
</a>
                        
</td>
    
</tr><tr class="tdbg" align="Center" style="height:23px;">
        
<td><href="javascript:ShowDetail('13')">13</a></td><td>100000</td><td>100,000.00</td><td>100,000.00</td><td>100,000.00</td><td>100,000.00</td><td>100,000.00</td><td>100,000.00</td><td>100,000.00</td><td>2005-11-02</td><td>
                            
<href="javascript:ShowDetail('13');">
                                查看详情
</a>
                        
</td>
    
</tr>
</table>
</form>
    
</body>
</HTML>
posted @ 2006-01-23 23:43  torome  阅读(327)  评论(0编辑  收藏  举报