2017-09-26 97 views
0

亞馬遜有一個生成HTML片段的工具,可以讓您顯示其商店中產品的圖像。未顯示HTML圖像

但是,當在本地運行時,圖像不顯示,在jsbin上運行時,它是。

本地代碼是:

<a href="https://www.amazon.co.uk/Complete-Idiots-Guide-Creating-Page/dp/0789722569/ref=as_li_ss_il?ie=UTF8&qid=1506425682&sr=8-10&keywords=web+development+for+idiots&linkCode=li2&tag=valuehistor0e-21&linkId=fc910756748618e2854e81a581107b24" target="_blank"><img border="0" src="//ws-eu.amazon-adsystem.com/widgets/q?_encoding=UTF8&ASIN=0789722569&Format=_SL160_&ID=AsinImage&MarketPlace=GB&ServiceVersion=20070822&WS=1&tag=valuehistor0e-21"></a><img src="https://ir-uk.amazon-adsystem.com/e/ir?t=valuehistor0e-21&l=li2&o=2&a=0789722569" 
 
    width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />

的JSBIN例子是here

+0

你檢查你的錯誤控制檯? – ProEvilz

+1

你正在運行的頁面作爲文件或通過本地服務器(參考「src =」// ws-eu.amazon *「)? – K3N

+0

@ K3N是的,意識到,幾乎只要我點擊」添加評論「和刪除太慢了我的不好 – Scoots

回答

2

你沒有說明怎樣運行的頁面:從本地文件或通過本地服務器。

在前一種情況下,所有帶有「// *」的鏈接都將採用不是有效鏈接的協議(例如「file://」)。

您可以硬編碼的協議而不是:

<a href="https://www.amazon.co.uk/Complete-Idiots-Guide-Creating-Page/dp/0789722569/ref=as_li_ss_il?ie=UTF8&qid=1506425682&sr=8-10&keywords=web+development+for+idiots&linkCode=li2&tag=valuehistor0e-21&linkId=fc910756748618e2854e81a581107b24" target="_blank"> 
<!-- The img src below --> 
<img border="0" src="https://ws-eu.amazon-adsystem.com/widgets/q?_encoding=UTF8&ASIN=0789722569&Format=_SL160_&ID=AsinImage&MarketPlace=GB&ServiceVersion=20070822&WS=1&tag=valuehistor0e-21"></a> 
<img src="https://ir-uk.amazon-adsystem.com/e/ir?t=valuehistor0e-21&l=li2&o=2&a=0789722569" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /> 
+1

我正在從一個文件運行代碼,正如你建議改變前綴改正了這個問題,謝謝。 –

0

適當的設置imgsrc圖像url中的標記。

例如:

<a href="https://www.amazon.co.uk/Complete-Idiots-Guide-Creating-Page/dp/0789722569/ref=as_li_ss_il?ie=UTF8&qid=1506425682&sr=8-10&keywords=web+development+for+idiots&linkCode=li2&tag=valuehistor0e-21&linkId=fc910756748618e2854e81a581107b24" target="_blank"><img border="0" src="https://static.pexels.com/photos/248797/pexels-photo-248797.jpeg" width="1000" height="300"></a>