源代码:
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script type="text/javascript">
function Person(name,sex)
{
   this.Name=name;
   this.Sex=sex;
   this.Say=function()
   {
     alert(this.Name);
   }
}
var p1=new Person("李浩","男");
p1.Person();
</script>
</head><body>
</body>
</html>
错误:
页面上什么也不显示各位大虾们给看看  什么问题的   
谢谢啦!!!!!!!

解决方案 »

  1.   


    <!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>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>无标题文档</title>
    <script type="text/javascript">
    function Person(name,sex)
    {
      this.Name=name;
      this.Sex=sex;
      this.Say=function()
      {
      alert(this.Name);
      }
    }
    var p1=new Person("李浩","男");
    p1.Say()
    </script>
    </head><body>
    </body>
    </html>
      

  2.   

    你是alert 页面当然什么也不显示 更何况你还没调函数
      

  3.   

    alert(this.Name);  这里 是 中文状态下的。
      

  4.   

    好几个中文状态的操作符号  Person("李浩","男");   这里的逗号,最kb是  p1.Person();这句,很无奈啊。
      

  5.   

    楼主书写错误,p1.Say()写成p1.Person()了
      

  6.   

    大虾们  这个函数是什么意思啊
    window.status
    谢谢啦