IOS10以上系统,混合内容(html为https,img为http),调用geolocation.getCurrentPosition时,background-image插入的图片不显示
<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插入。浏览器根本不会请求此类内容。
关于IOS10以上系统,混合内容,背景图片插入图片不显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46824947/