New issue 10 by york.ric...@gmail.com: mobile-bookmark-bubble not displaying
http://code.google.com/p/mobile-bookmark-bubble/issues/detail?id=10
What steps will reproduce the problem?
1. Go to http://www.gwpahs.org/m/index.html
2. mobile-bookmark-bubble does not appear
3. No error messages or anything.... Just doesn't appear
What is the expected output? What do you see instead?
I am using iphonenav.js for our mobile site and have changed the following
to localStorage as described in the comments of example.js but no
mobile-bookmark-bubble is displayed:
bubble.setHashParameter = function() {
if (!this.hasHashParameter()) {
window.localStorage += parameter;
}
};
What version of the product are you using? On what operating system?
iPhone 4 (4.2.1) + Xcode iOS SDK Emulator (iPad/iPhone etc) on OS X for
some testing
Please provide any additional information below.
Links to significant files:
http://www.gwpahs.org/m/bookmark_bubble.js
http://www.gwpahs.org/m/example.js
http://www.gwpahs.org/m/iphonenav.js
As mentioned above, I have changed the following to localStorage as
described in the comments of example.js but is still not working (am I
missing something or is there more too it):
bubble.setHashParameter = function() {
if (!this.hasHashParameter()) {
window.localStorage += parameter;
}
};
Maybe I need to make more changes but Im not too sure where....?
Your setHashParameter() function uses window.localStorage incorrectly.
Check out this tutorial from Dive Into HTML5 for more details:
http://diveintohtml5.org/storage.html#methods
Try something like this instead:
var BUBBLE_STORAGE_KEY = 'bubble';
bubble.hasHashParameter = function() {
return window.localStorage[BUBBLE_STORAGE_KEY];
};
bubble.setHashParameter = function() {
window.localStorage[BUBBLE_STORAGE_KEY] = '1';
};
Thanks for taking the time to reply. I'm still having issues as I don't
fully understand what the problem is. I have tried the code provided above
and it didn't work for me.
Is there a way of simply not using cookies or html5 localStorage and just
display the bubble by clicking a hyperlink?
As you can probably tell, Im not too good with JavaScript but this bubble
is such a great idea I'd love to integrate it into out mobile site...
Many thanks,
Rich
Sorry for the delay in getting back to you.
I just tried downloading your code and running it locally, and it worked
fine for me. One thing to note is that with your implementation of
setHashParameter(), the bubble will only ever be shown once per device
(unless the user clears their cache). For testing, you might want to change
this so that the bubble is _always_ shown:
bubble.setHashParameter = function() { }
bubble.hasHashParameter = function() {
return false;
}
Thanks, I have tried the above code and the bubble still does not display.
I have no idea what is stopping it from displaying. Im getting close to
giving up now :( Thanks for you help and patience
Do you have the current version of your code running somewhere that I can
experiment with it? It looks like the links in your initial bug report are
still pointing to an older version of the code that uses
window.localStorage.
Hi, yes sorry it is now back to your latest suggestion. Many thanks for
your continued support!
Sorry, I've been swamped with other projects recently. I'll take a look at
this as soon as I can. :)
It looks like the add to homescreen link now just shows an alert() with
text instructions. Is there somewhere else that the bookmark bubble is
being triggered?
I've been having the identical issue, cropped up recently although am
unaware how long I've overlooked it.
I've made no changes to the js, until going through this post to attempt to
fix the issue with the comments provided.
A live instance of this occurrance:
http://www.allscenes.com/allscenes
http://www.allscenes.com/allscenes/static/js/bookmark_bubble.js
http://www.allscenes.com/allscenes/static/js/bookmark.js
What I find odd is that I've made no change to cause the issue,
Does the library rely on any external resources??
I do have other google services installed (Analytics & Translate) but
removing them has no change so I don't thing they're conflicting.
Help appreciated.
Going through our sites today my issue has resolved itself oddly enough.
Unsure as to the original cause or indication as to how it resolved on it's
own (Wasn't just from me restarting as it was occurring on my other devices
as well).
Glad to hear it's working again. For the record, the library doesn't rely
on any external resources.
Hi there,
When I use the code you have provided in comment 1. It does show the bubble
only once and then doesn't show it. It's probably works this way because it
is storing the value inlocal storage. I want it to be shown if it has been
dismissed twice. (using NUMBER_OF_TIMES_TO_DISMISS field documented in the
bookmark_bubble.js) When you use this code does this field hold no
importance?