2017-10-19 45 views
0

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> 

回答

1

這是正確的行爲。在https頁面上,所有http內容都不能顯示,因爲它不安全。即使它通過JS插入。瀏覽器根本不會提出這樣的內容請求。