use of com.gargoylesoftware.htmlunit.javascript.host.event.UIEvent in project htmlunit by HtmlUnit.
the class Document method setLocation.
/**
* Sets the value of the {@code location} property. The location's default property is "href",
* so setting "document.location='http://www.sf.net'" is equivalent to setting
* "document.location.href='http://www.sf.net'".
* @see <a href="http://msdn.microsoft.com/en-us/library/ms535866.aspx">MSDN documentation</a>
* @param location the location to navigate to
* @throws IOException when location loading fails
*/
@JsxSetter
public void setLocation(final String location) throws IOException {
final Object event = getWindow().getEvent();
if (event instanceof UIEvent) {
final Object target = ((UIEvent) event).getTarget();
if (target instanceof HTMLAnchorElement) {
final String href = ((HTMLAnchorElement) target).getHref();
}
}
window_.setLocation(location);
}
Aggregations