current property (history)
Returns the URL of the current document in the history array.
This property requires the UniversalBrowserRead privilege in Firefox.
Syntax:
You can find the related objects in the Supported by objects section below.
This property is read-only.
Possible values:
String that represents the URL.
Default: this property has no default value.
Example HTML code 1:
This example illustrates the use of the current property:
|
||||
<head> <script type="text/javascript"> function GetCurrentURL () { // UniversalBrowserRead privilege is required in Firefox try { if (window.netscape && netscape.security) { // Firefox netscape.security.PrivilegeManager.enablePrivilege ("UniversalBrowserRead"); } } catch (e) { alert ("UniversalBrowserRead privilege is required in Firefox!"); return; } if ('current' in window.history) { alert (window.history.current); } else { alert ("Your browser does not support this example!"); } } </script> </head> <body> <button onclick="GetCurrentURL ()">Get the current URL!</button> </body> |
||||
|
||||
Did you find this example helpful?
|
Supported by objects:
Related pages:
External links:
User Contributed Comments