Javascript jquery locks up in Safari (only) - javascript

I've created a website which uses javascript to run a jquery gallery viewer. A problem surfaces when using the gallery in Safari only (but not with Chrome, Firefox, etc).
At first, the gallery runs smoothly. But if you click through enough pictures (on a single gallery page, or over several pages containing different galleries) eventually the gallery script stops working. At that point, all of the gallery functions stop, even if you visit a different gallery on a different page in the website. Neither refreshing the page, a hard refresh, clearing the cache, visiting a different gallery/page, or closing the tab and re-opening in a new tab, brings back the functionality. The only way to get it working again is to close the Safari window, open a new window, and go to the page again. (I wonder what the browsing session has to do with this?)
I have tried using the console, and tried using Firebug Lite, to diagnose the problem, without success. No errors appear in the console when the script stops working; the controls just stop working.
I can duplicate the problem reliably on different machines running Safari (most easily by repeatedly and quickly cycling through the pictures in a gallery over and over till it locks up). I cannot duplicate the problem using any other browser.
Any help in figuring out what's wrong, or even suggestions of how to troubleshoot the problem, would be greatly appreciated!
The galleries can be found here:
http://www.gailcohenphotography.com/galleries.html
Many thanks,
- Paul

Related

Pannellum in iFrame suddenly stopped working

I have a simple "360 Tours" page on a client's Opencart website, using an iFrame on an info page. The page opens with an outside view, the visitor can then select other areas to view by clicking links below. The viewer code pannellum.htm and all the panoramic images are hosted on the client's server with the viewer displayed in an iFrame based on Pannellum's examples.
This was trivial to get working and has operated correctly for months but recently stopped working, displaying nothing where the panoramas once were. I tried Chrome, Firefox & Safari under OSX, Windows and an iPad without Joy. However, this morning I noted that my Chromebook still worked perfectly. So, I updated the Chromebook and it too stopped working. Nothing at my end has changed, though I did update to the latest pannellum.htm today to no avail.
A JS function load360() forms a url and loads this into the .src property of the iFrame which is located by id. Originally, the working code looked like this:
let url=...
let frame=document.getElementById("mf-360");
frame.src=url;
frame.contentWindow.location.reload(true);
Searching reveals that the reload is not required and simply assigning a new url to the .src property should be enough to force a refresh of the iFrame. Removing the reload had no effect, and in fact having it there stops the viewer from ever displaying. However, assigning a blank string to .src then the required url like this..
let url=...
let frame=document.getElementById("mf-360");
frame.src='';
frame.src=url;
..seems to work, but only every _second) time load360 is called.
Does anyone have any idea what's going on?? I'm more of an electronics-design/embedded guy and any help here would be most appreciated..
The site is https://www.davidcoils.com - click '360 Tours' at the top.

Javascript - Page slow to show after not being the active tab

So I have developed a webpage containing some javascript and a couple of HighChart charts.
The page generally works great, every few seconds data is fetched from the server using an ajax request, and the chart is updated.
The issue happens when I have switched to a different tab for a few minutes and then want to go back. The page can take a very long time to show up. This happens on both Chrome and Firefox.
I couldn't really find out how the browser is handling javascript and page updates in non-active tabs, but it seems to be related at least.
Any ideas on how to improve the time it takes for the page to show?
To be perfectly clear, the page has no visible performance issues while it is the active tab.
So it turns out we froze highcharts just a couple of versions before this fix went in.
When we upgraded the version, everything worked great!
Many thanks to #WojciechChmiel for pointing me in the right direction.

javascript - different behaviour on page refresh

I have a really weird problem.
I have a site (running wordpress), and I use jquery roundabout plugin.
When I visit the site with the address bar, the site is displayed fine. When I'm already in the site and I hit refresh - everything is messed up. I checked in both chrome and firefox, and I get the same result. In IE there is no problem.
Also, I noticed that the problem occurs only when doing a soft refresh (F5) and it's ok when doing a hard refresh (Ctrl+F5)
You can check for yourself in my test site
http://50.112.34.111
try to press enter in the address bar a few times - should display ok. try to refresh - and you'll see the problem...
First of all I would try to put the JS includes (<script.../>) in the header AFTER all CSS includes! That might already help. Since the CSS might influence your JS, JS has to know all CSS before it gets loaded.

Website wont show on IE once I activate scripts. Everything is missing except for the background

So, I've been creating a site based off a template. The site used to work on IE, but I'm afraid that I have made changes since then that causes everything to go haywire. When first visiting the site my grids and alignments are all off and most of the javascript doesnt work. When I activate scripts and ActiveX all of the elements of the site are invisible except for the background. Though, I can still see the source in this instance.
The site (for now) is: http://www.escroft.com/index(main).html
If the site is not displaying when you turn scripts on, you probably have a script error. Open your developer tools with F12, and reload the page; the console should show you what errors you have, and then you're on your way to fixing them.

Lightbox with IFrame is flickering when clicking on links

I've got the same problem with this post:
How to fix flickering in IFrames?
Unfortunately, there's no solution (and I'm afraid of negative ratings too :) ).
I can't provide a page where you can see the behaviour (as it's intranet) - but I'll try to explain it:
When I open an external page via lightbox, I get a disturbing 'flickering' when clicking on links... i.e. I try to open an image gallery located on an internal server - clicking on the "next" link lets the page flicker before moving on to the next page.
If I open any other web page (google, some newspaper, ...) I do not get this behaviour - it's much faster, so it seems like the content of the first page is replaced by the content of the next one. In my image gallery it's much slower: the first page disappears, then the next page appears. I get this flickering only with lightbox-popup, not, if I load the page in another window.
I tried differend JavaScript frameworks (jQuery, Scriptaculous, Standalone) - so I guess it's my image gallery which causes this behaviour... any ideas?
It would be really (!) appreciated... thanks!
Best regards,
Stefan
As Max mentions, source would be useful.
Also, try using Fiddler or Firebug's Net panel to look at the actual HTTP requests that are being made - perhaps your image gallery is POSTing to itself before redirecting to another page?

Categories