如何在html页面加载结束时执行任何特定的操作



有没有办法查明HTML页面是否已完成加载?,

我必须在HTML页面加载结束时进行一些组合框加载。请帮我做这个。

更新:

my question is how to load some values after page is completely loaded not only the images,css, etc but also all the controls in it, like some text boxes may have values from the server and so on.

向致以最诚挚的问候

在JavaScript中使用window.onload事件处理程序。

你试过这个吗?

window.addEventListener("load", function() {
      // put stuff into combo boxes
});

或者,如果您使用的是jQuery,请使用经典的:

jQuery(document).ready(function(){
    // combo box loading
}); 

我想,如果您使用jQuery

,那么引用组合框也会更容易

最新更新