且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

替代< body onload =" init();">

更新时间:2023-09-22 23:36:40

<script type="text/javascript">
    function init() {
        // Put your code here
    }
    window.onload = init;
</script>

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

Or, if you are using jQuery:

$(function() {
    // Your code here
});