Getting current url on pageinit event

Getting current url on pageinit event

Hi,

I would like to know how to get current url on pageinit event properly, since both window.location and history.getActive() returns previous url. It seems that the newest url is applied as the last thing after changing page.

I found one way to get it by:

  1. $(document).on("pageinit", function(e) {
  2.       var url = e.target.baseURI;
  3. });
Unfortunatly, it does not work on some devices :(

I use the newest jQuery Mobile and jQuery.