Manuel Araoz
Manuel Araoz

Reputation: 16406

Changing URL via AJAX using wicket

Is there a way to make an AJAX call alter the current page URL without redirecting or reloading the page, in Apache Wicket?

For example, say we are in the URL:

localhost:8080/someUrl

I'd like that when I click an ajax link, some action is performed, and the URL changes to, say:

localhost:8080/otherUrl

without redirecting, just changing the URL displayed in the browser. Is this even possible?

Upvotes: 2

Views: 2254

Answers (4)

Hendy Irawan
Hendy Irawan

Reputation: 21384

Help make this feature happen, vote (or contribute!) for https://issues.apache.org/jira/browse/WICKET-5290

Upvotes: 1

martin-g
martin-g

Reputation: 17513

Actually you can ! But this is not related to Wicket at all. This is what the new History API in HTML5 is about. Just search for "html5 History API example" in Google and enjoy.

Upvotes: 4

SeanCannon
SeanCannon

Reputation: 77966

The only part of the url you can change with javascript is the hash

You could change localhost:8080/#/someUrl to localhost:8080/#/otherUrl

Do this with window.location.hash

Here's an example of a flash site which uses this concept to allow for deep-linking URL's: http://www.2advanced.com

Upvotes: 3

Bozho
Bozho

Reputation: 597096

No, it isn't. If you change the location in the browser, a new request is made to that URL.

(You do that with window.location.href = newUrl, but the page reloads)

Upvotes: 0

Related Questions