在网页上显示图标的问题

时间:2017-06-22 15:39:10

标签: javascript html jsp

我遇到了一个愚蠢的问题。请帮忙。我想显示一个信息图标,点击后,应该打开一个pdf。尽管图标存在于服务器中,但图标不会显示。但是,当我在控制台上粘贴相同的代码时,它会显示出来。以下是代码 -

<script type="text/javascript">
function open_win(){
	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;">
	<div class="title" style="margin: 10px 0px 10px 0px;" align="center">
		Analyzed Devices Overview [<%
		Calendar now = Calendar.getInstance();
		int year = now.get(Calendar.YEAR);
		out.println((year - 2) + " - " + year + "]");
	%>
	    <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 个答案:

答案 0 :(得分:1)

如果您在window.open中删除换行符,则不会收到错误。

&#13;
&#13;
declare var UIkit:any;

deleteData(dataArr): void {

  UIkit.modal.confirm('Are you sure you want to delete this?', () => {

    console.log(this);
    // [...]
  });
}
&#13;
&#13;
&#13;