1. 程式人生 > >img標籤src引用網路圖片,頁面不顯示,返回403錯誤,網路圖片地址在瀏覽器能載入,放html卻不能顯示

img標籤src引用網路圖片,頁面不顯示,返回403錯誤,網路圖片地址在瀏覽器能載入,放html卻不能顯示

在html頁面加入<meta name="referrer" content="no-referrer">標籤,就可以解決頁面載入網路圖片的問題,

原因大概是網路安全的問題,別人的頁面做了安全防護的問題。

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" 
content="telephone=no,email=no,date=no,address=no"> <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" /> <meta http-equiv="Pragma" content="no-cache" /> <meta http-equiv="Expires" content="0" /> <meta name="referrer" content="no-referrer"
/> <!--可以讓img標籤預載入網路圖片-->