1. Separate the JS method common.js
functionOpenwin (src) {varBasePath = document.getElementById ("BasePath"). Value; SRC= BasePath +src; //alert (SRC);Openwindow=window.open ("", "Newwin", ", Toolbar=no,menubar=no,scrollbars=yes,resizable=yes,location=no,status=no"); //Write a lineOpenWindow.document.write ("<TITLE> View pictures </TITLE>"); OpenWindow.document.write ("<body bgcolor= #ffffff >"); //OpenWindow.document.write ("OpenWindow.document.write ("); OpenWindow.document.write ("</BODY>"); OpenWindow.document.write ("</HTML>"); OpenWindow.document.close (); }
2. Embed the JSP in the desired call
<%StringBasePath=Request.getscheme ()+ "://" +Request.getservername ()+":"+Request.getserverport ()+Request.getcontextpath ()+ "/";%><inputtype= "hidden"value= "<%=basePath%>"ID= "BasePath" /><Scriptlanguage= "JavaScript"type= "Text/javascript"src= "<%=basepath%>js/biz/common.js"></Script>
<href= "javascript:void (0);" onclick = "Openwin (' ${mem.idcard}/');" title = "Click to view original image" >< src= "${mem.idcard}/" width= " height=" "/></a>
JS pop-up picture original effect