Closed GoogleCodeExporter closed 8 years ago
jQuery mobile's usage of location.hash for page addressing, history, navigation:
http://jquerymobile.com/demos/1.0a2/#docs/pages/docs-navmodel.html
Original comment by jason.p.morrison
on 20 Dec 2010 at 10:58
Sorry for the late response -- I've been away on holidays for the past couple
weeks.
The idea behind using a hash parameter is that it will persist in the URL
across browser reloads and will be saved with any bookmark the user creates.
This lets you do things like:
a) detect when the user has bookmarked your app after seeing the bubble, so you
can track the effectiveness of the promo
b) avoid showing the bubble if the user has already seen it
There's a risk of a poor user experience if you just use a local variable: if
the user bookmarks your application and then comes back later by tapping on the
bookmark, they may see the bubble again, prompting them to bookmark your
application -- but they've already done that.
I've pushed a documentation update noting that this conflicts with jQuery
Mobile.
Original comment by ntho...@google.com
on 4 Jan 2011 at 5:46
Issue 9 has been merged into this issue.
Original comment by ntho...@google.com
on 18 Jan 2011 at 1:57
As a workaround, I use the HTML5 history object to adjust the URL without a
page refresh, and without using the hash tag. This seems to work for me. See
below for code:
var parameter = 'bmb=1';
bubble.hasHashParameter = function () {
return window.location.search.indexOf(parameter) != -1;
};
bubble.setHashParameter = function () {
if (!this.hasHashParameter()) {
if (window.location.search.indexOf('?') == -1) {
window.history.replaceState('Object', 'Title', window.location + '?' + parameter);
} else {
window.history.replaceState('Object', 'Title', window.location + '&' + parameter);
}
}
};
Original comment by AndrewKo...@gmail.com
on 28 Jul 2012 at 3:41
Original issue reported on code.google.com by
jason.p.morrison
on 20 Dec 2010 at 10:57