tags:

views:

72

answers:

2
+4  A: 

Use History.addValueChangeHandler( handler ), and create a handler to catch the URL changes.

There's no need for click handlers etc., any change of the "hash" part in the URL will be sufficient.

EDIT:

See this code example - it will parse URLs of the form http://mydomain/my/path#tok1&tok2&tok3

public void onValueChange(ValueChangeEvent<String> event) {
  String hash = event.getValue();
  if ( hash.length() == 0 ) {
    return;
  }
  String[] historyTokens = hash.split("&",0);
  // do stuff according to tokens
}
adamk
@adamk - Thanks Adam, I implemented History.addHistoryListener, and it is responding to changes in the URL. However, now the function I have looking for the Querystring can't see anything past the '#'. Is there another way to get the entire Querystring?
cinqoTimo
I edited my answer to add a working code sample.
adamk
+4  A: 

(Just responding to your Update) Have you tried

History.getToken()

to get the value after the "#"?

Chris Boesing