Google Analytics MIME type issue in Chrome using Rails 3 - ruby-on-rails

I'm adding GA to a Rails 3 app, which would normally be extremely simple, of course. I've added the GA JS snippet, which is rendering just fine. Everything works perfectly in Safari. In Chrome, however, it's giving me a console error: Resource interpreted as Script but transferred with MIME type text/html: "about:blank", pointing to the JS line that loads the ga.js file: s.parentNode.insertBefore(ga, s). Some things I've investigated:
I created a plan HTML page with the JS snippet, and it loads outside Rails in Chrome with no error.
The same HTML page, when put in /public, gives the error above.
The same HTML page, loaded in Safari from /public, doesn't give any error according to Firebug.
I tried the GA Debug extension in Chrome, but it remains silent, because ga.js isn't getting loaded.
Looking at the developer console in Chrome, I see a request for "http://www.google-analytics.com/ga.js" that seems to stay in "pending" state, and a redirect to "about:blank" seemingly initiated by http://www.google-analytics.com/ga.js, which makes very little sense.
So this seems to be related to Rails (since the snippet works in the HTML outside Rails), and doesn't affect Safari, but other than that I'm stumped. Hopefully I've just been staring at it wrong, and someone else will point out the obvious to me...? Anyone come across this before? Any ideas will be very much appreciated.

Came across this issue myself. "Disconnect" disabled share buttons on my site (g+, twitter and fb). Had to remove it to view the site properly.

Related

iOS Safari loads a wrong page

I've met a very strange bug when tried to open my web site http://akr-congress2016.ru/ in iOS Safari. Please see the screenshot below.
It seems like some elements are loaded from a completely other web site. The new site is a copy of the old one, but layout files (I'm using Phalcon) are changed. There is no link to the old web site at the page.
Also I've noticed doubled logo, it seems like a rendering bug.
When I refresh the page it is loaded normally.
I'm weird what might make Safari to load some fragments of the page from completely another domain.
The screenshot
Try to remove cache from browser. Or maybe it's just an issue of DNS. In that case you just need to wait untill DNS will get updated.

Rails 3 Links are broken after activescaffold update

I just updated active scaffold on my rails app, and now all the links are broken on the site. If I hover over the link in firefox, I can see http://localhost:3000/correct_link; however, when I click the link, I end up at http://localhost:3000/current_link#__1_. When the link is loaded all styling/javascript is messed up. Furthermore, the number after the two underscores increases every time I click another link, but I can never navigate away from http://localhost:3000/current_link__NUM_.
Interestingly, if I type the url that I want into the browser, all is well. There don't seem to be any errors in my logs or in my server console.
I'm not sure how to go about debugging this
Aha! The error was caused by my removing active_scaffold, which introduced some weird behavior from custom javascript that had hooked into it. After active scaffold was removed, the javascript started hijacking the links. Shuffling the javascript around fixed the bug

How to get Back button working between remote and local jQuery Mobile pages?

I have a local jQuery Mobile project going (inside PhoneGap, thus file:// protocol) where I sometimes need to fetch external pages (using http://) from a server where the content too are jQM pages with almost identical markup (except for the content, which is generated from a CMS).
Setting $.mobile.allowCrossDomainPages to true gives me the page, and that is all right. Going Back, however, fails. I get stuck in a place where /www/index.html is not found on the server (like, doh, of course..). Is there a way to "remember" where I came from, taking me back to the local html page I originally came from?
We just added a docs page on PhoneGap in jQuery Mobile for RC3 that should help you out quite a bit:
http://jquerymobile.com/test/docs/pages/phonegap.html

Why does SIFR rendering this page in Chrome as a blank page?

In chrome - http://unitonenine.com/ loads for a few seconds that changes into a blank white page. This site was working fine up until a few months ago.
Upon inspection it just loads the 2 swf files. In FireFox it loads just fine.
Any thoughts?
I posted some information regarding the same bug that seems to be removed. So I poked around the javascript source for sifr r436 and discovered as was mentioned here:
http://discuss.joyent.com/viewtopic.php?id=24243
That there was an issue with the prefetch function and indeed commenting the prefetch function out fixes the problem. I looked at the site linked above and this is not their solution. I have not been able to figure out how they resolved it, the prefetch function is unchanged on their site. So removing the prefetch would make this problem go away, however it is important to know that this will slow total page load time by putting off calling the flash file until after the rest of the page loads.

sIFR seems to be loading correctly but not displaying text

I'm Using sIFR 3r436, and although I believe everything is set up correctly, and my console shows that the .swf font file is loading correctly, the HTML type is hidden but the sIFR type is not displaying. Below is a link to the site in question:
Schaffer's Website
Below is a link to a test site that uses exactly the same sifr-config.js, sifr.js, css, and swf files. And it works. The main difference between the two is the server that they are running on.
Schaffer's Test Site
I'm hoping that maybe somebody can see a problem that I'm unable to. Appreciate the help!
The server gives a 403 forbidden for the Flash movie – in other words, it does not load.

Resources