New issue 7 by jason.p.morrison: Hash parameter conflicts with jQuery mobile
http://code.google.com/p/mobile-bookmark-bubble/issues/detail?id=7
What steps will reproduce the problem?
1. Write a jQuery Mobile page
2. Use the mobile-bookmark-bubble script with the example ?bmb=1 hash param
What is the expected output? What do you see instead?
Ideally, it would not conflict. Since jQuery Mobile uses hash params as a
page addressing scheme, the usage of hash parameter here conflicts, and
jquery mobile tries to load a page via xhr e.g. "HTTP GET /bmb=1".
What version of the product are you using? On what operating system?
Latest HG head. iOS 4.x.
Please provide any additional information below.
I used a local variable instead, but am not completely familiar with the
ramifications. I'm not sure where/if this behavior should be changed or
just documented.
$(document).ready(function() {
setTimeout(function() {
var bubble = new google.bookmarkbubble.Bubble();
var varForHashParameter = false;
bubble.hasHashParameter = function() {
return varForHashParameter;
};
bubble.setHashParameter = function() {
varForHashParameter = true;
};
bubble.showIfAllowed();
}, 1000);
});
jQuery mobile's usage of location.hash for page addressing, history,
navigation:
http://jquerymobile.com/demos/1.0a2/#docs/pages/docs-navmodel.html
Comment #2 on issue 7 by ntho...@google.com: Hash parameter conflicts with
jQuery mobile
http://code.google.com/p/mobile-bookmark-bubble/issues/detail?id=7
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.
Issue 9 has been merged into this issue.