I have just upgraded my iOS because of the recent security bug, and I find that my website is no longer loading properly on my phone!
I've boiled the problem down to a simplified example...
index.html =
<html>
<head>
<title>Demo</title>
<meta name="description" content="Test of basic Javascipt function">
<script src="demo.js"></script>
</head>
<body class="body">
<div id="main">
</div>
</body>
</html>
demo.js =
var i = 0;
function update() {
'use strict';
document.getElementById("main").innerHTML = i;
i = i + 1;
}
setInterval(update, 1000);
On my desktop this produces an iterating count, but when viewed with Safari on my phone (Mobile/12G34 Safari/601.1) the javascript file simply does not load???? The Javascript file doesn't even show up under the "All Resources" tab in my WebInspector which I am tethering via USB.
Suggestions?
Thanks,
Bill
Edit:
This question has gotten no response, but I'm still wrestling with this problem. I've found some more information.
Using the Safari WebInspector I've found that the javascript is not loading because...
Blocked script execution in 'http://192.168.133.1/demo.html' because
the document's frame is sandboxed and the 'allow-scripts' permission
is not set.
Since I'm serving this page off a homespun webserver on an esp8266, this message has inspired me to tune up my HTTP headers. The HTTP headers appear to be fine.
I can't figure out how this html page is getting sandboxed in the first place, and how to 'allow-scripts' so that I can run my script in Safari Mobile.
Any help would be much appreciated.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…