But if you preview your album locally, by simply opening index.html from your hard drive, this code causes serious problems in Chrome and in the jAlbum integrated browser, and locks up IE11 completely. The reason is found in that fifth line. When you're running locally, it ends up trying to load the GA script from:
This, of course, fails miserably, and not in a graceful way.
There are two ways to work around this problem. If you know for a fact that you will always be serving your pages with the http: protocol, and never with the secure https: protocol, you can change the fifth line to this:
Re: New Google Analytics code, and local preview
in response to: jGromit
An update. Google Analytics finally realized that they were doing this the hard way. Now, the code they tell you to use always connects to Google with the secure https protocol. This will, of course, work properly on any page, whether the page itself is using http or https, and it doesn't cause any problems when viewing a page locally.