简体   繁体   English

请帮助我在.ascx网络用户控件中了解此脚本

[英]Please help me understand this script within a .ascx web user control

The following is found within a .ascx web user control, and I'm trying to figure out where I would find "localtable_" and what the last line is doing. 在.ascx Web用户控件中可以找到以下内容,并且我试图弄清楚在哪里可以找到“ localtable_”以及最后一行在做什么。

<script language="javascript" type="text/javascript">
    function ClickTable(me)
    {
        var tables = document.getElementsByTagName("table");
            for(n = 0; n < tables.length; n++)
                if(tables[n].id.indexOf("localtable_") > -1)
                    tables[n].className = "";
        me.className = "CommitteeTableBackground";
    }
</script>

Try view source of the Page from the Browser where the user control is used. 尝试从使用用户控件的浏览器中查看页面的源代码。 It should give you all the tables starting with localtable_ Ids. 它应该给您所有以localtable_ Ids开头的表。

  1. The script is setting the class names of all tables with Ids that start with "localtable_" to empty. 该脚本会将ID以“ localtable_”开头的所有表的类名设置为空。
  2. Setting the current table class name to CommitteeTableBackground. 将当前表类名称设置为CommissionTableBackground。 May be this done to highlight only the currently selected class. 可以这样做以仅突出显示当前选择的班级。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM