Mobile Safari requires external Javascript from another domain which is blocked or failed to load

javascriptmobile-safari

When using Mobile Safari on my iPhone (4, iOS 5.0.1) to view this site, I am not able to log in using the top right drop down arrow that is seen on the mobile view. Nor am I able to enter the full site rather than use the mobile version. Both of these buttons "click" (in that they highlight as if pressed when I touch them) but nothing happens at all.

At the bottom of the page is a notice that reads "Apple requires external JavaScript from another domain, which is blocked or failed to load."

Javascript error when loading stackexchange sites directly in Mobile Safari

However, when I follow a link to this site within Twitter, using the in-app webview without loading it directly in Mobile Safari this error does not show, and I am able to log in and enter the full site without any issues.

Javascript works from Twitter, as shown through the use of the login button

I don't know when this started happening, but I am sure it used to work, and other users of matching kit report that it works for them. It's possible that this happens on other sites that use JavaScript, but this is the only one I have noted it on thus far.

To fix it, I have already tried the following:
1) Clear History
2) Clear Cookies and Data
3) Turned JavaScript on and off
4) Hard reset the phone
5) Removed all Website Data

Best Answer

Turning on the Developer Toolbar showed lots of JavaScript errors, specifically:

undefined, typeerror, can't find variable $

This indicates that $, the "root" variable for jQuery was not set and therefore jQuery was not loaded.

Further, the error ajax.googleapis....ery/1.7.1/jquery.min.js - syntaxerror - parse error showed that the cached version of the jQuery library was corrupted and this is the reson why jQuery's $ was not loaded.

Force quitting Safari and clearing the cache again resolved the issue.