I'm trying to pass some parameters to a page-id made in jQuery Mobile.
The site is composed of list-views with links, each of them has the hash coded in it, like this:
<li><a href="#pronostico?region=12&ciudad=0">Puerto Natales</a></li>
I have binded pagebeforechange
to catch hashes in the URL, do parameter detection and take action depending on the amount of parameters passed.
Now, with cookies, I've been trying this:
$(document).one("pageinit", function(event, data) {
if (location.hash.search(/^(#ciudades|#pronostico)/) === -1) {
if ($.cookie("recordar")) {
$.mobile.changePage($("#pronostico"), {
data: "region=" + $.cookie("region") + "&ciudad=" + $.cookie("ciudad")
});
}
}
});
But it just passes me to the #pronostico
page-id, with no parameters in the hash. As a result, I get a page without the information it is supposed to show.
Thanks in advance.