1 (edited by steenamaroo 2015-01-30 21:42:01)

Topic: XML file not found only on some mobile devices after splash screen.

Hi all.

I'm using JB lite at http://petegardiner.co.uk/?p=pics and have run into a problem, but only on some mobile devices.


First, my instance of JB always opens with the splash screen on mobile devices. Perhaps that's normal? I don't mind.
The splash screen always loads without issue on any device, and shows an image from the gallery in question, so obviously the xml file is being found OK at that stage.

Tapping to open gallery on my iPhone 4s or my friends iPhone 4, though, takes me to the /jbcore/full.html address and says xml file not found.

However, the gallery works perfectly on another iPhone 4 to which I have access. (and a 3gs and a 5s - all safari)
Between all these devices I can say the fault isn't specific to one model or iOS version.

Interestingly my 4s has no problem opening the gallery if I use chrome, so the problem seems to be exclusive to, but not consistent on, safari mobile.

Additionally, the two phones which are having issues would have visited this site and gallery in the past.
I did clear browsing history and caches on my 4s but this made no difference.




This issue came to my attention because I recently created a second gallery and used onclick/script to populate the container with whichever gallery the user wants to see, so there's only ever one active gallery at any time.
Switching between galleries (splash screens, at least) works fine on any device.
I have tried reverting to a single gallery setup, though, and this hasn't helped.

Also, I'm using custom gallery names like gigs.xml, for example, and am pointing to them using configURL.

If I can provide any more info I'd be happy to, and if anyone can help I'd much appreciate it.



My embed code is below.
The buttons are actually elsewhere in my page code but I've included them at the bottom anyway.

<div class="grid_10 main">
        <h1>Galleries</h1>

    <!--START JUICEBOX EMBED-->
    <script src="includes/gallery/jbcore/juicebox.js"></script>


        <!--Auto Gallery here-->
        <script>
          new juicebox({
          containerId: "juicebox-container",
          configUrl: "includes/gallery/simpson.xml",
          galleryWidth: "100%",
          galleryHeight: "70%",
          backgroundColor: "#222222",
          });

        </script>



          <!--Gallery choice scripts here-->
          <script>
          function simpson (){
          new juicebox({
          containerId: "juicebox-container",
          configUrl: "includes/gallery/simpson.xml",
          galleryWidth: "100%",
          galleryHeight: "70%",
          backgroundColor: "#222222",
          });
          }
          </script>

          <script>
          function misc (){
          new juicebox({
          containerId: "juicebox-container",
          configUrl: "includes/gallery/misc.xml",
          galleryWidth: "100%",
          galleryHeight: "70%",
          backgroundColor: "#222222" 
          });
          }
          </script>
          <div id="juicebox-container"></div>
</div>      
      
      <button onclick="simpson()">Gallery one title</button><br><br>
      <button onclick="misc()">Gallery two title</button>
      

Re: XML file not found only on some mobile devices after splash screen.

First, my instance of JB always opens with the splash screen on mobile devices. Perhaps that's normal? I don't mind.

The Splash Page is used by default when the gallery is displayed in Small Screen Mode.
For more information on Screen Modes and how Juicebox adapts to different devices and screen sizes, please see here.

If you had Juicebox-Pro, then you could disable the Splash Page by setting showSplashPage="NEVER".
Alternatively (again with Juicebox-Pro only), you could force the gallery to be displayed in Large Screen Mode (which does not use the Splash Page by default) in all browsers and on all devices by setting screenMode="LARGE".

With regard to your "Config XML file not found." problem, I have just viewed your web page in Chrome and Mobile Safari on an iPod Touch 4 and everything seems to be working OK for me.
I have switched between your galleries and have opened both (several times) from their respective Splash Pages.

I do not see any obvious problems with your code (although your web page should include a Doctype Declaration to inform the user's browser what set of standards the code on your web page conforms to).

The most likely reasons for your problem (that I can think of at the moment) are:
(1) A temporary glitch on your web server (perhaps unable to server the gallery's XML file in a timely manner).
(2) A browser caching problem (although you have already considered this).
(3) The mobile device is using a 3G/4G connection instead of wi-fi.

If any of the mobile devices you have tried viewing your website on have been using a 3G/4G connection, then please see this FAQ which includes a solution to this problem.
Why can't I view my gallery on a 3G mobile connection?

Otherwise, please double-check that your browser's cache has been completely cleared and perhaps contact your web host to see if they have been experiencing any problems recently which might be contributing to your problem.

3 (edited by steenamaroo 2015-01-31 14:51:46)

Re: XML file not found only on some mobile devices after splash screen.

Hi Steven,
Thank for you for taking the time to reply.
I understand about the splash screen. Thanks.


I have now added doctype to my header.php. I presume this is enough?
As you say, it's not likely to cause the issue but I'd rather sort it.


Your suggestions.
1: I can't see a temporary glitch causing it but only because the results have been consistent across devices.
I sat with a 3gs (working) and a 4s (not working) and refreshed the two in tandem.
The 3gs consistently worked and the 4s consistently showed xml not found.

2: I do wonder if there's a deeper clean I can do. I really don't want to reset my iPhone just to find out, but I'd like to be able to 100% rule out browser cache.

3: Thank you for this information. I actually became aware of this yesterday and embedded the required code.
Since then (just before I posted here), mobile and wifi have worked just fine.

The problematic devices still show xml not found whether on 3g or wifi.
The working devices work via either connection.

I will contact my web host, but I have a feeling this thing is too specific to be a hosting issue.

Do you (or any other members here) have other ios/safari devices you could test on? If you wouldn't mind, of course.
So far the only failing devices are my iPhone and the site owner's iPhone.
If no one else can replicate the problem I'm happy to assume there isn't one and move on.

Many thanks once again.
Paul.

Re: XML file not found only on some mobile devices after splash screen.

I have now added doctype to my header.php. I presume this is enough?

Now that you have added a Doctyle Declaration to your web page, you can check your web page for HTML errors using the W3C Markup Validation Service and fix any errors reported (although I do not see any errors on your page which would result in the problem you are experiencing).

If your gallery displays fine in Chrome but not in Mobile Safari, then it certainly sounds like the problem may be due to Safari caching. Maybe you could try renaming your gallery XML files (and the corresponding configUrl entries) on your web server to names that have never been used (or cached) before. This may help.

Re: XML file not found only on some mobile devices after splash screen.

Thank you Steven.
Such a simple idea; I can't believe I didn't think of that.

I went ahead and changed the filenames and paths and, unfortunately, it did not make a difference.
I'm not even sure what to do now, apart from fixing page errors. Can't do any harm, I guess.

6 (edited by steenamaroo 2015-02-01 16:09:55)

Re: XML file not found only on some mobile devices after splash screen.

Just to follow up, I've completely ruled out caching as I set up 6 or 7 brand new galleries on another website today with the same results.


I also uploaded the entire 'web' folder from the JB template and accessed it 100% vanilla to test.
The demo gallery worked immediately on my phone.
So, clearly there's something wrong with my file edits or structure but I have no idea what, or why it would be specific to two devices.

The only big difference I can see between that and my setup is that my embed code page is up one level, but I've specified all the paths with config url etc.

Brain = fried.

Re: XML file not found only on some mobile devices after splash screen.

So far the only failing devices are my iPhone and the site owner's iPhone.

It is certainly strange that the problem has only been seen on two iPhones and only in Mobile Safari.

Is there anything that the two iPhones have in common? Are they the same generation as each other and what versions of iOS do they each run? (It's a long shot but the more information we have the better.)

I have uploaded a test page with a couple of galleries (using essentially the same code, switching mechanism and file structure that your own web page uses) here. [Test page removed.]
Please try to view the galleries on this different web server using your iPhones to see if you see the same problem as in your own scenario.

Re: XML file not found only on some mobile devices after splash screen.

Hi again Steven.
Thanks so much for going to that trouble. It's certainly appreciated.

I'm almost pleased to say I get the same problem with your gallery.
The only time I got any gallery to work perfectly was when I uploaded a vanilla demo folder and went directly to the stock index.html, but manual embedding of any kind results in the perfect splash page and the "xml not found" upon opening the gallery, on the devices mentioned.


Non-working
My iPhone 4s - iOS 8.1.3 (and on 8.1.2)
My friend's iPhone 4 - iOS 7.0.4

Working perfectly
iPhone 5s - iOS 8.1.3
iPhone 3GS - iOS 7.? latest.

Re: XML file not found only on some mobile devices after splash screen.

I have no problem viewing my own test galleries in Mobile Safari on an iPod Touch 4 (I have no access to any other iOS devices at the moment).
The problem seems to occur only on your two iPhones (and only in Mobile Safari).
I really cannot explain why the galleries might fail only on two specific devices.

Please try viewing the two galleries in this test page which switches between the galleries using a slightly different mechanism.

If this works, then perhaps you could try using this method in your own web page.
It simplifies the code by passing a baseUrl (pointing towards a specific gallery folder) as a parameter to a single function which loads the selected gallery. (You can check the source of the web page in a browser and copy/modify it to suit your own needs.)

Details can be found in the 'Switching between Multiple Galleries using JavaScript' section of the Embedding Multiple Galleries support page.

10 (edited by steenamaroo 2015-02-03 02:18:36)

Re: XML file not found only on some mobile devices after splash screen.

Thanks for this Steven.
Unfortunately the demo galleries on that guide page fail in the same way.

I'll spend some time at this tomorrow and report back.
If uploading the untouched example (in the JB download folder) worked for me then there has to be some way around this.

11 (edited by steenamaroo 2015-02-03 21:44:18)

Re: XML file not found only on some mobile devices after splash screen.

I've tried no end of things today.
I figured getting the gallery to work by direct access (i.e. not in the context of my website) was a good way to go and I'd work from there, but I couldn't even get that done.
The code works fine in an isolated index.html but fails to work once embedded in my pics.php, everything else being equal.

Thanks.

Re: XML file not found only on some mobile devices after splash screen.

As the problem has been seen only on your two iPhones, then it seems logical that there may be something common to both of them which is causing the problem.
Are they both trying to access your web page via the same wi-fi network?
Perhaps you could take the iPhones elsewhere, connect to a different network and try accessing your web page from there.

It seems unlikely that this would make a difference but it is a strange problem and I would not rule anything out at this point.

13 (edited by steenamaroo 2015-02-04 15:23:21)

Re: XML file not found only on some mobile devices after splash screen.

Thanks Steven.
I'm going to leave you alone now because I did a small survey on another forum and found plenty of iOS7/8 iphone 4/4s users on safari who have no problem with my galleries.

That combined with today's troubleshooting does prove it to these two devices, as much as I don't understand it.
Either way, the issue clearly isn't with Juicebox and I thank you once again for your time.

I can't think of any common ground between the two phones.
The other chap would be on a mobile network and I am on my home network (also tried with 3G).

The fact that your test galleries don't work for me is very strange indeed, however, as is the fact that directly accessing a gallery's html (rather than embedding) works fine.
As I said earlier if I can be confident that it isn't affecting anyone else, and I now am, I'm happy enough.

All the best, Steven.

Re: XML file not found only on some mobile devices after splash screen.

That combined with today's troubleshooting does prove it to these two devices, as much as I don't understand it.

I really do not know what the root of the problem is, either.
I am glad, however, that the problem seems to be limited to only two known devices (although why this might be is still a mystery).

Re: XML file not found only on some mobile devices after splash screen.

If it's something you want to pursue (for personal interest) this person seems to have had the same issue in 2012.
http://juicebox.net/forum/viewtopic.php?id=337

Many thanks.

Re: XML file not found only on some mobile devices after splash screen.

Thank you for the link to the other forum thread.
I would very much like to figure this out but without being able to replicate (or even see) the problem myself, troubleshooting is difficult.

If you have the time and inclination, you might like to try using absolute paths for your configUrl entries to see if this makes a difference. None of the galleries you have tested above use absolute paths for configUrl or baseUrl entries. If the problem is somehow related to an error in resolving a relative path to find the XML file, then using an absolute path might avoid this problem.

You might also like to try adding a unique query string entry to your configUrl entries to prevent any possible caching. (Although you have already ruled out caching as a possible cause of the problem, I would still give this a try, just in case it somehow helps.) For example:

configUrl: "includes/gallery/simpson1.xml?nocache=" + new Date().getTime(),

These suggestions may or may not make a difference but they are things that I would try myself and should be fairly quick and easy to implement.

I should perhaps also point out that on an iOS device, the gallery is expanded from the Splash Page in a new page by default. (Please see here for details.) If you were using Juicebox-Pro, you could try setting expandInNewPage="FALSE" to force Juicebox to expand the gallery in the same page (on top of the embedding page) rather than in a new one. You could also embed the gallery directly in the web page without using a Splash Page by setting showSplashPage="FALSE" or you could force the gallery to use Large Screen Mode (which does not use the Splash Page by default) on all devices and in all browsers by setting screenMode="LARGE". However, these suggestions are applicable to Juicebox-Pro only.

Re: XML file not found only on some mobile devices after splash screen.

Yeah, I understand there's not much you can do if you can't replicate the problem.

For anyone else reading this, I have already tried absolute URLs and just now I tried
"includes/gallery/simpson1.xml?nocache=" + new Date().getTime();," with no change.
Thank you for the suggestions, none the less.


It's still bugging me a little because the demo folder works when accessed directly.
Also for your info, I tried doing away with the directory structure of my site by moving all the php files into the same level and rewriting the links between them.
I genuinely thought that would solve the problem but it didn't either.

At one point I actually had the demo html file and my own pics.php side by side in the same folder.
The html accessed directly worked but the same code called within my pics page didn't.

Ah well, on the extreme off chance that I get any more info on this, I'll be sure to report it here.
Thanks.