public class Location extends SimpleScriptable
Constructor and Description |
---|
Location()
Creates an instance.
|
Modifier and Type | Method and Description |
---|---|
Object |
getDefaultValue(Class hint)
Return the javascript default value of this object.
|
void |
initialize(Window window)
Initializes the object.
|
void |
jsxFunction_assign(String url)
Loads the new HTML document corresponding to the specified URL.
|
void |
jsxFunction_reload(boolean force)
Reloads the current page, possibly forcing retrieval from the server even if
the browser cache contains the latest version of the document.
|
void |
jsxFunction_replace(String url)
Reloads the window using the specified URL.
|
String |
jsxFunction_toString()
Returns the location URL.
|
String |
jsxGet_hash()
Returns the hash portion of the location URL (the portion following the '#').
|
String |
jsxGet_host()
Returns the host portion of the location URL (the '[hostname]:[port]' portion).
|
String |
jsxGet_hostname()
Returns the hostname portion of the location URL.
|
String |
jsxGet_href()
Returns the location URL.
|
String |
jsxGet_pathname()
Returns the pathname portion of the location URL.
|
String |
jsxGet_port()
Returns the port portion of the location URL.
|
String |
jsxGet_protocol()
Returns the protocol portion of the location URL, including the trailing ':'.
|
String |
jsxGet_search()
Returns the search portion of the location URL (the portion following the '?').
|
void |
jsxSet_hash(String hash)
Sets the hash portion of the location URL (the portion following the '#').
|
void |
jsxSet_host(String host)
Sets the host portion of the location URL (the '[hostname]:[port]' portion).
|
void |
jsxSet_hostname(String hostname)
Sets the hostname portion of the location URL.
|
void |
jsxSet_href(String newLocation)
Set the location URL to an entirely new value.
|
void |
jsxSet_pathname(String pathname)
Sets the pathname portion of the location URL.
|
void |
jsxSet_port(String port)
Sets the port portion of the location URL.
|
void |
jsxSet_protocol(String protocol)
Sets the protocol portion of the location URL.
|
void |
jsxSet_search(String search)
Sets the search portion of the location URL (the portion following the '?').
|
String |
toString()
Returns the string value of the location, which is the full URL string.
|
get, getBooleanArg, getClassName, getDomNodeOrDie, getDomNodeOrNull, getIntArg, getLog, getObjectArg, getPrototype, getScriptableFor, getStartingScope, getStringArg, getTransformerScriptableFor, getWindow, getWindow, getWithPreemption, makeScriptableFor, setDomNode, setDomNode, setHtmlElement
associateValue, callMethod, callMethod, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, deleteProperty, deleteProperty, equivalentValues, get, getAllIds, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getFunctionPrototype, getGetterOrSetter, getIds, getObjectPrototype, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getTopLevelScope, getTopScopeValue, has, has, hasInstance, hasProperty, hasProperty, isConst, isSealed, put, put, putConst, putConstProperty, putProperty, putProperty, redefineProperty, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setGetterOrSetter, setParentScope, setPrototype
public Location()
public void initialize(Window window)
window
- The window that this location belongs to.public Object getDefaultValue(Class hint)
getDefaultValue
in interface org.mozilla.javascript.Scriptable
getDefaultValue
in class SimpleScriptable
hint
- A hint as to the format of the default value. Ignored in this case.public String toString()
public void jsxFunction_assign(String url) throws IOException
url
- The location of the new HTML document to load.IOException
- If loading the specified location fails.public void jsxFunction_reload(boolean force) throws IOException
force
- If true, force reload from server; otherwise, may reload from cache.IOException
- When there is a problem reloading the page.public void jsxFunction_replace(String url) throws IOException
url
- The new URL to use to reload the window.IOException
- When there is a problem loading the new page.public String jsxFunction_toString()
public String jsxGet_href()
public void jsxSet_href(String newLocation) throws IOException
newLocation
- The new location URL.IOException
- If loading the specified location fails.public String jsxGet_search()
public void jsxSet_search(String search) throws Exception
search
- The new search portion of the location URL.Exception
- If an error occurs.public String jsxGet_hash()
public void jsxSet_hash(String hash) throws Exception
hash
- The new hash portion of the location URL.Exception
- If an error occurs.public String jsxGet_hostname()
public void jsxSet_hostname(String hostname) throws Exception
hostname
- The new hostname portion of the location URL.Exception
- If an error occurs.public String jsxGet_host()
public void jsxSet_host(String host) throws Exception
host
- The new host portion of the location URL.Exception
- If an error occurs.public String jsxGet_pathname()
public void jsxSet_pathname(String pathname) throws Exception
pathname
- The new pathname portion of the location URL.Exception
- If an error occurs.public String jsxGet_port()
public void jsxSet_port(String port) throws Exception
port
- The new port portion of the location URL.Exception
- If an error occurs.public String jsxGet_protocol()
public void jsxSet_protocol(String protocol) throws Exception
protocol
- The new protocol portion of the location URL.Exception
- If an error occurs.Copyright © 2002-2012 Gargoyle Software Inc.. All Rights Reserved.