漫漫技术人生路

C#

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="TestJa.aspx.cs" Inherits="Test_TestJavascript_TestJa" %>

<!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" type="text/javascript">
    <!--
    function checkMail()
    {
      var strMail = document.getElementById("txtMail").value;
     
      if(strMail.indexOf("@") == -1)
      {
        alert("wrong Email format");
       
        document.form1.txtMail.focus();
      }
    }
   
    //
   
    function BulidObject()
    {
      var1={x:1,y:2,z:3};
      var1={lst1:{x:1,y:2},lst2:{z:3,o:4}};

      for(it in var1)
      {
        for(rt in var1[it])
        {
          document.write(var1[it][rt]);
        }
      }
    }
   
    //
  
    function bodyload()
    {
      alert('frist');
    }
    //-->
    </script>
   
</head>
<body onload=" alert('frist');">
<script language="javascript" type="text/javascript">
   
    function FromFun()
    {
      alert("from Fun");
    }
   
    myActive="FromFun()";
   
    if(document.body.onload.toString())
    {
     eval(document.body.onload.toString().replace('anonymous()','bodyload()'));

     
      document.body.onload=new Function("bodyload();"+myActive);

    }
    else
    {
      document.body.onload=new Function(myActive);
    }
</script>
    <form id="form1" runat="server">
    <div>
    <input type="text" id="txtMail" onblur="checkMail();" />
   
    <input type="button" id="btObject" value="BulidObject" onclick="BulidObject();" />
    </div>
    </form>
</body>
</html>

posted on 2006-12-05 09:56  javaca88  阅读(135)  评论(0)    收藏  举报