pbcweb / mobile-bookmark-bubble

Automatically exported from code.google.com/p/mobile-bookmark-bubble
Apache License 2.0
0 stars 0 forks source link

jQuery mobile problem add to home screen and loading #9

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.bug  jquery mobile combined with bookmark_bubble when add to homescreen and 
loaded the webapp

What is the expected output? What do you see instead?
i click on the icon on the springboard the page loaded and after ... there is 
just a blank page. 

What version of the product are you using? On what operating system?
i use jquery mobile 1.0.2 with the latest revision of bookmark_bubble and the 
problem is on a iPhone 4 4.2.1

Please provide any additional information below.
if i delete these two lines who call the bookmark_bubble script my web app runs:
    <script type="text/javascript" src="js/bookmark_bubble.js"></script>
    <script type="text/javascript" src="js/example.js"></script>

and here is my code between <head> </head>
<head>
    <meta charset="utf-8" />
    <meta content="yes" name="apple-mobile-web-app-capable" />
    <link href="pics/logo.png" rel="apple-touch-icon" />
    <link href="pics/startup.png" rel="apple-touch-startup-image" />
    <link rel="apple-touch-icon-precomposed" href="IMG/icon_calendar.png" />
    <title></title>
    <link rel="stylesheet"  href="themes/default" />
    <link rel="stylesheet" href="docs/_assets/css/jqm-docs.css" />
    <link rel="stylesheet" href="themes/default/accueil.css" />
    <script src="js/"></script>
</head> 

Original issue reported on code.google.com by S3BHO...@gmail.com on 17 Jan 2011 at 8:01

GoogleCodeExporter commented 8 years ago
The example code (in example.js) uses a hash parameter to track when the user 
has seen the bookmark bubble. This is known to be incompatible with jQuery 
Mobile. This comment in bookmark_bubble.js explains:

 * NOTE: Using a hash parameter to track whether the bubble has been shown
 * conflicts with the navigation system in jQuery Mobile. If you are using that
 * library, you should implement this function to track the bubble's status in
 * a different way, e.g. using window.localStorage in HTML5.

Try changing the setHashParameter() method on your Bubble object to not 
actually modify the hash. Details are given in issue 7.

Original comment by ntho...@google.com on 18 Jan 2011 at 1:57

GoogleCodeExporter commented 8 years ago
thanks for the reply i have changed  like this:
bubble.setHashParameter = function() {
      if (!this.hasHashParameter()) {
        window.localStorage += parameter;/* change for works with jquery mobile*/

and it works !! thanks

Original comment by S3BHO...@gmail.com on 18 Jan 2011 at 11:58

GoogleCodeExporter commented 8 years ago
How is localStorage supposed to replicate the behaviour of the hash changing? 
You would change the localStorage in any case and thus never know whether the 
user comes from a bookmark or just manually revisits your page.

Original comment by myr...@gmail.com on 27 May 2011 at 11:05

GoogleCodeExporter commented 8 years ago
You're right, using localStorage instead of the hash does have the disadvantage 
that you can't tell if the user came from the bookmark or not. It does, 
however, still let you keep track of whether the bubble has been shown before, 
in order to avoid annoying users by showing the bubble every time they come 
back to your webpage.

Original comment by ntho...@google.com on 28 May 2011 at 7:03

GoogleCodeExporter commented 8 years ago
Thanks for showing how to fix this, I too was having problems, and know very 
little javascript.

So thanks again :)

Original comment by coop...@gmail.com on 6 Jun 2011 at 1:47

GoogleCodeExporter commented 8 years ago
Glad I found this post as it stopped the "Error Loading Page" when the web app 
first loads. However it still throws the error message when you use the close 
icon.

Any idea how to also stop this?

Thanks, John

Original comment by dbrawl...@googlemail.com on 29 Jul 2011 at 10:51