javascript URL attributes
Translation results:
UK[ˌju: ɑ:r ˈel] US[ˌju:ɑ:r'el]
abbr.Uniform Resource Locator is used to specify the location of information on the Internet's WWW service program. Method
Plural: URLs
javascript URL attributessyntax
Function: Return the URL of the current document.
Syntax: document.URL
Description:Generally, the value of this property is the same as the location.href property of the Window containing the document. . However, when a URL redirect occurs, the URL property holds the actual URL of the document, while location.href holds the requested URL.
javascript URL attributesexample
<html> <body> <meta charset="UTF-8"> 该文档的 URL 是: <script type="text/javascript"> document.write(document.URL) </script> </body> </html>
Run instance »
Click the "Run instance" button to view the online instance