
This interface contains information about the current URL.
IHTMLLocation Methods
HRESULT put_href(
BSTR v
);
Sets the entire URL for the browser. Setting this property causes the browser to navigate to the location specified by the URL.
See also get_href
HRESULT get_href(
BSTR *p
);
Retrieves the URL of the current browser location.
See also put_href
HRESULT put_protocol(
BSTR v
);
Sets the protocol portion of the URL that the browser uses to locate the item. The protocol portion, which indicates the access method, includes the initial substring of the URL up to and including the first colon.
See also get_protocol
HRESULT get_protocol(
BSTR *p
);
Retrieves the protocol portion of the URL that the browser uses to locate the item. The protocol portion, which indicates the access method, includes the initial substring of the URL up to and including the first colon.
See also put_protocol
HRESULT put_host(
BSTR v
);
Sets the hostname portion of the location or URL.
See also get_host
HRESULT get_host(
BSTR *p
);
Retrieves the hostname part of the location or URL.
See also put_host
HRESULT put_hostname(
BSTR v
);
Sets the hostname portion of the location or URL.
See also get_hostname
HRESULT get_hostname(
BSTR *p
);
Retrieves the hostname part of the location or URL.
See also put_hostname
HRESULT put_port(
BSTR v
);
Sets the port number in a URL.
See also get_port
HRESULT get_port(
BSTR *p
);
Retrieves the port number from the URL.
See also put_port
HRESULT put_pathname(
BSTR v
);
Sets the file or object path of the URL.
See also get_pathname
HRESULT get_pathname(
BSTR *p
);
Retrieves the file or object path from the URL for the current browser location.
See also put_pathname
HRESULT put_search(
BSTR v
);
Sets the substring that follows the ? symbol in the current URL. This is the query string or form data.
See also get_search
HRESULT get_search(
BSTR *p
);
Retrieves the substring that follows the ? symbol in the current URL. This is the query string or form data.
See also put_search
HRESULT put_hash(
BSTR v
);
Sets the string following the # symbol in the URL.
This property is useful for moving to a bookmark within a document. Assigning an invalid value does not cause an error.
See also get_hash
HRESULT get_hash(
BSTR *p
);
Retrieves the string following the # symbol in the current URL.
This property is useful for moving to a bookmark within a document. Assigning an invalid value does not cause an error.
See also put_hash
HRESULT reload(
VARIANT_BOOL flag
);
Reloads the current page.
HRESULT replace(
BSTR bstr
);
Replaces the current document by loading the document at the given URL. This method also removes the current document from the browser's session history.
Replacing a document causes it to no longer be accessible through the history object.
See also IOmHistory
HRESULT assign(
BSTR bstr
);
Sets the current location to the given URL. This method loads the given document specified by the URL if it exists.
HRESULT toString(
BSTR *string
);
Retrieves a string representation of the location object that is the href of the current browser location.
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.