我遇到了一个愚蠢的问题。请帮忙。我想显示一个信息图标,点击后,应该打开一个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>
答案 0 :(得分:1)
如果您在window.open中删除换行符,则不会收到错误。
declare var UIkit:any;
deleteData(dataArr): void {
UIkit.modal.confirm('Are you sure you want to delete this?', () => {
console.log(this);
// [...]
});
}
&#13;