Document.Location Property
The Location property returns the location of the current document. The location is the full path without the file name. This property is read-only.objDoc.Location As String
Parameters
objDoc 
Object expression that resolves to a Document object. 
Return Values
The location of the current document.Example Code [Visual Basic]
' Retrieve the document location.
Dim strLoc As String
strLoc = objDoc.Location
MsgBox (strLoc)
Requirements 
  Windows NT/2000/XP: Included in Windows XP and Windows .NET Server.
  Windows 95/98/Me: Unsupported.

解决方案 »

  1.   

    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>无标题文档</title>
    </head><body>
      <script language="jscript">
        document.writeln(document.location+"<br>");
        document.writeln(window.location);
    //window.document.location="http://www.163.com";
    //window.location="http://www.163.com";
      </script>
    </body>
    </html>
    发现document.location和window.location返回的值一样,这是为什么?
      

  2.   

    document.location 相当于 document.URL
    声明了装载文档的URL,除非发生了服务器重定向,
    否则该属性的值与Window.location.href的值是一样的.
      

  3.   

    好象在哪看过document.location是只读的。window.location是可读可写的。