2017-09-26 55 views
0

Amazonには、店舗からの商品の画像を表示するための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> 

関連する問題