添加一个函数到window.onload里==常用小函数

 <script language="javascript" type="text/javascript">
     function addLoadEvent(func){
var oldonload=window.onload;
if(typeof window.onload!="function"){window.onload=func;}else{window.onload=function(){oldonload();func();}};
}
    function uNameFocus(){document.getElementById("uName").focus();}
    addLoadEvent(uNameFocus);

              </script>

posted @ 2009-03-02 15:50  彭成刚  阅读(232)  评论(0编辑  收藏  举报