2017-06-22 7 views
0

私は愚かな問題で立ち往生しています。助けてください。私は、クリックするとpdfを開くべきである情報アイコンを表示したい。アイコンはサーバーに存在しても表示されません。しかし、同じコードをコンソールに貼り付けると、表示されます。以下のあなたがエラーを取得することはできませんwindow.openで改行を削除するとコード -ウェブページにアイコンを表示する際の問題

<script type="text/javascript"> 
 
function open_win(){ 
 
\t window.open("../resources/Devices_overview_explained_v1_final.png","_blank", 
 
    "toolbar=no, location=no, directories=no, status=no, menubar=no, 
 
    scrollbars=yes, resizable=no, copyhistory=yes, width=805, height=700"); 
 
} 
 
</script> 
 

 
<div id="sysOverview" style="width: 855px; margin-top: 40px;"> 
 
\t <div class="title" style="margin: 10px 0px 10px 0px;" align="center"> 
 
\t \t Analyzed Devices Overview [<% 
 
\t \t Calendar now = Calendar.getInstance(); 
 
\t \t int year = now.get(Calendar.YEAR); 
 
\t \t out.println((year - 2) + " - " + year + "]"); 
 
\t %> 
 
\t  <input type="image" src="../resources/images/Infoicon_Intel.png" 
 
     class="tooltip_info_img" alt="" onclick="open_win()"> 
 
    </div> 
 
</div>

Screenshot showing the code works when pasted on console

答えて

1

です。

<script type="text/javascript"> 
 
function open_win(){ 
 
\t window.open("../resources/Devices_overview_explained_v1_final.png","_blank", "toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=yes, width=805, height=700"); 
 
} 
 
</script> 
 

 
<div id="sysOverview" style="width: 855px; margin-top: 40px;"> 
 
\t <div class="title" style="margin: 10px 0px 10px 0px;" align="center"> 
 
\t \t Analyzed Devices Overview [<% 
 
\t \t Calendar now = Calendar.getInstance(); 
 
\t \t int year = now.get(Calendar.YEAR); 
 
\t \t out.println((year - 2) + " - " + year + "]"); 
 
\t %> 
 
\t  <input type="image" src="../resources/images/Infoicon_Intel.png" 
 
     class="tooltip_info_img" alt="" onclick="open_win()"> 
 
    </div> 
 
</div>

+0

こんにちはデイヴィッド、お返事に感謝。ここにコードを投稿しているときに改行を追加しました。元のコードでは、改行はありません。 – PalB

+0

現在、どのようなエラーメッセージが表示されますか? –

+0

エラーメッセージは表示されません。アイコンはWebページに表示されません。 – PalB

関連する問題