IOS10以上系统,混合内容,背景图像插入图片不显示
问题描述:
IOS10以上系统混合内容(html by https,img by http),当调用geolocation.getCurrentPosition,background-image插入的图片不显示时IOS10以上系统,混合内容,背景图像插入图片不显示
<pre>
<div id="aaa" style="background-image:url(http://xxx.jpg);height:200px;"></div>
<script>
navigator.geolocation.getCurrentPosition(function (res) {
console.log(res);
});
</script>
</pre>
答
这是正确的行为。在https页面上,所有http内容都不能显示,因为它不安全。即使它通过JS插入。浏览器根本不会提出这样的内容请求。