页面完全加载时调用javascript函数

时间:2016-11-02 06:17:35

标签: javascript load

我有一个js函数,需要在页面完全加载时调用。我尝试在body上调用该函数,如下所示

onload="GridExpInfo_ClientInsert()"

但它没有按预期工作,它会在页面完全加载之前调用。

更新

代码:

function GridExpInfo_ClientInsert() {
        var rowVal = "0";                  // assigned variable with value as 0
        for (i = 0; i < GridExpInfo.Rows.length; i++) {
            rowVal = i;                   // assigning values which always takes the value of i
            if (GridExpInfo.Rows[i].Cells[7].Value == "" || GridExpInfo.Rows[i].Cells[7].Value == "0") {
                document.getElementById('GridExpInfo_ob_GridExpInfoBodyContainer_ctl33_' + rowVal + '_ctl00_' + rowVal + '_Button1_' + rowVal + '').style.display = "none";
            }
            else {
            }
        }
    }

0 个答案:

没有答案