js

我要做的东西能是有一个JS一定要在页面全部加载完后执行请哪位高人给个JS代码。

解决方案 »

  1.   

    window.onload = function() {
    //在这里执行js
    }
      

  2.   

    window.onload = function() {
    //在这里执行js
    }放到页面body的最下方
      

  3.   

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>无标题页</title>
        <script language="javascript">
            function test()
            {
               //你的代码
            }
        </script>
    </head>
    <body onload ="test();">
        <form id="form1" runat="server">
        <div>
            
        </div>
        </form>
    </body>
    </html>
      

  4.   


    <script type="text/javascript" >
    window.onload=function()
    {
        //你的代码
    }
    </script>这个放在你页面的最下面
      

  5.   

    window.onload = function() {
    //在这里执行js
    }
    可以放到网页任何地方
      

  6.   

    我自己在JavaScript完全解析里面有介绍的:可以用core程序库;
    var name =
    {
         init:function()
    {
          your html modifying code
    }
    };
    core.start(name)js的core库网上有的吧
      

  7.   

    Core.start = function(runnable)
    {
      Core.addEventListener(window, "load", runnable.init);
    };