<body>
  <script type="text/javascript">
  <!--
    alert(window.location.href);
  //-->
  </script>
 </body>

解决方案 »

  1.   


      <script type="text/javascript">
      <!--
    var strHref = window.location.href;
    var pageName = strHref.slice(strHref.lastIndexOf("/")+1)
    alert(pageName);
      //-->
      </script>
      

  2.   

    alert(window.location.href);
    之后,如果再做个字符串处理就更好了!!!!
      

  3.   

    document.title
    这个好像是标题吧!!!
      

  4.   

    document.title//由<head><title>设置的文档名
    location.href//文档的地址,如:http://community.csdn.net/Expert/topic/5559/5559200.xml?temp=.734112
      

  5.   

    设置或获取对象指定的文件名或路径。
    <script>
    alert(window.location.pathname)
    </script>设置或获取整个 URL 为字符串。
    <script>alert(window.location.href);
    </script>
    设置或获取与 URL 关联的端口号码。
    <script>
    alert(window.location.port)
    </script>设置或获取 URL 的协议部分。
    <script>
    alert(window.location.protocol)
    </script>设置或获取 href 属性中在井号“#”后面的分段。
    <script>
    alert(window.location.hash)
    </script>设置或获取 location 或 URL 的 hostname 和 port 号码。
    <script>
    alert(window.location.host)
    </script>设置或获取 href 属性中跟在问号后面的部分。
    <script>
    alert(window.location.search)
    </script>
      

  6.   

    <!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=utf-8" />
    <title>shawl.qiu template</title>
    <script type="text/javascript">
    //<![CDATA[
     onload = 
      function()
      {
      
      }
      alert(fGetPageName());
      
      function fGetPageName()
      {// shawl.qiu script
       var sSeparator = "/";
      
       if(location.protocol.indexOf("file")>-1)
       {
        sSeparator ="\\";
       }
       var url = document.URL;
       var ar = url.split(sSeparator);
       var FileName = ar[ar.length-1];
       var PageName = FileName.split(".")[0];
       
       return [PageName,FileName];
      }
      
    //]]>
    </script>
    </head>
    <body></body>
    </html>
      

  7.   

    哦....这样才可以无错...<!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=utf-8" />
    <title>shawl.qiu template</title>
    <script type="text/javascript">
    //<![CDATA[
      alert(fGetPageName());
      
      function fGetPageName()
      {// shawl.qiu script
       var sSeparator = "/";
      
       if(location.protocol.indexOf("file")>-1)
       {
        sSeparator ="\\";
       }
       var url = document.URL;
       var ar = url.split(sSeparator);
       var FileName = ar[ar.length-1];
       var PageName = FileName.replace(/^(.*)\..*/, "$1");
       FileName = FileName.replace(/\?.*$/, "");
       
       return [PageName,FileName];
      } // end function fGetPageName
      
    //]]>
    </script>
    </head>
    <body></body>
    </html>
      

  8.   

    页面名称?浏览器那个标题?
    那不就是
    document.title