jsp<input type="image" ...>和<img ...>的区别

<input type="image" src="" onclick="...">

当该标签在<form></form>中时,在浏览器中点击显示的图片后,效果等同于submit,即表单提交,但用该标签显示的图片,图片名称中可包含中文字符。

<img src="" onclick="...">

使用该标签时,以包含中文字符命名的图片不能正常显示。但可在图片上设置点击图片后的效果,如页面跳转或打开页面,window.open("....jsp");也可编写javascript脚本,设置点击后的动作效果。

<%-- Created by IntelliJ IDEA. User: Administrator Date: 2025/6/4 Time: 22:04 To change this template use File | Settings | File Templates. --%> <%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ page import="java.sql.*"%> <html> <head> <title>Title</title> <style> body{ background-color: aquamarine; } .main{ background-color: antiquewhite; margin:0 auto; width:60%; padding-left: 40px; padding-right: 40px; } .main div{ background-color: #F0F8FF; padding:10px; } </style> </head> <body> <% response.setContentType("text/html;charset=UTF-8"); request.setCharacterEncoding("utf-8"); String bookid = request.getParameter("bookid"); Class.forName("com.mysql.jdbc.Driver"); String url = "jdbc:mysql://localhost:3306/book"; String un = "root"; String pass = "root"; Connection con = DriverManager.getConnection(url,un,pass); String sql = "select * from books where id = ?" ; PreparedStatement pre = con.prepareStatement(sql); pre.setString(1,bookid); ResultSet rs = pre.executeQuery(); while(rs.next()){ String id = rs.getString("id"); String urls = rs.getString("url"); String name = rs.getString("bookname"); String writer = rs.getString("writer"); String syn = rs.getString("syn"); float price = rs.getFloat("price"); String stock = rs.getString("stock"); %> <form action="BOOKXIUGAI_OK.jsp?id=<%=id%>" method="post"> <div class="main"> <img src="<%=urls%>" width="180" height="256" alt="图片"/> <div>图片:<input type="text" name="urls" value="<%=urls%>"></div> <div>ID:<input type="text" name="id" disabled="disabled" value="<%=id%>"></div> <div>商品名:<input type="text" name="name" value="<%=name%>"></div> <div>品类:<input type="text" name="writer" value="<%=writer%>"></div> <div>简介:<textarea type="text" name="syn" rows="4" cols="50"><%=syn%></textarea></div> <div>价格:<input type="text" name="price" value="<%=price%>">元/件</div> <div> 库存:<input type="text" name="stock" value="<%=stock%>"></div> <div> <input type="submit" name="submit" value="提交"></div> <div> <a href="REMOVEBOOKS.jsp?id=<%=id%>">删除此书</a></div> <div><hr></div> </div> </form> <% }pre.close();rs.close(); %> </body> </html> 简单优化一下不要太复杂
06-13
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>1-用户登录</title> <style type="text/css"> a{text-decoration:none} body{ background-image:url(../img/longmao.webp); background-size: cover; height: 100vh; } h3{ color:#FFF; font-size:30px; } td{ color:#FFF; font-size:20px; } .ps{ padding-top:0px; } </style> <script type="text/javascript"> function refreshVerifyCode() { // 刷新验证码 var verifyCodeImage = document.getElementById("verify_codeImage"); verifyCodeImage.src = "../VerifyCodeServlet?" + Math.random(); } function register() { window.location.href = "register.jsp"; } </script> </head> <body > <h3>新闻发布系统>>用户管理>>登录</h3><hr color="#FFF"> <div class="ps"> <form action="../LoginSerlvet" method="post" name="frm_login"> <table align="center"> <tr> <td>用户名:</td> <td> <input type="text" name="userName"value="张凯"> </td> </tr> <tr> <td>密码:</td> <td> <input type="password" name="userPassword" value="1111"> </td> </tr> <tr> <td>验证码:</td> <td> <input type="text" name="verifyCode" value=""> <img src="../VerifyCodeServlet?t=<%=System.currentTimeMillis()%>" id="checkcode" onclick="this.src='../VerifyCodeServlet?t='+new Date().getTime()"/> </td> </tr> <tr> <td height="50" colspan="2" align="center"> <input type="submit" name="ok" value="提交"> <input type="reset" name="cancel" value="取消"> <input type="button" onclick="register();" value="注册"> </td> </tr> </table> </form> </div> </body> </html>加一个3.Ajax异步验证。登录时账号输完马上显示账号重复了。
06-08
有网页的源码,怎么在idea里用vue复现,运用element-UI组件,view-source:https://rloopbase.nju.edu.cn/ ,源码如下: <html xmlns="http://www.w3.org/1999/xhtml " xml:lang="en" lang="en"> <link rel="stylesheet" type="text/css" href="/css/myIndex.css"> <head> <title>R-loopBase</title> <link rel="icon" href="/images/icon-rloop-purple-circle-2.png" type="image/x-icon"> </head> <body> <div class="container"> <div class="indexBar"></div> <div class="card"> <!-- Introduction --> <div class="cardTitle"> Introduction </div> <div class="cardContext"> <p id="introductionText" class="cardP">The R-loop, a three-stranded nucleic acid structure composed of an RNA:DNA hybrid and a displaced single-stranded DNA, plays versatile roles in many physiological and pathological processes. However, its controversial genomic localization and incomplete understanding of its regulatory network raise great challenges for R-loop research. Here, we present R-loopBase to tackle these pressing issues by systematic integration of a huge amount of genomics and literature data. A reference set of human R-loop zones is computed with confidence scores and detailed annotations (<span style="font-weight: bold"><a href="/index.jsp">Search</a></span>, <span style="font-weight: bold"><a href="/help.jsp">Help</a></span> and <span style="font-weight: bold"><a href="/download.jsp">Download</a></span>), all of which can be visualized in well-annotated genomic context in a local genome browser (<span style="font-weight: bold"><a href="https://rloopbase.nju.edu.cn/browser/cgi-bin/hgTracks ">Browser</a></span>). A list of 1,185 R-loop regulators is manually curated from PubMed literatures and annotated with most up-to-date multi-omics data (<span style="font-weight: bold"><a href="/rloopRegulator.jsp">Regulator</a></span></span>). We have also manually curated 24 R-loop regulators in mouse, 63 in yeast (<i>saccharomyces cerevisiae</i>) and 21 in <i>Escherichia coli</i> to facilicate R-loop research in these model organisms (<span style="font-weight: bold"><a href="/rloopRegulator.jsp">Regulator</a></span>). We further deduce the functional relationship between individual R-loops and their putative regulators (<span style="font-weight: bold"><a href="/rloopRegulator.jsp">Regulator</a></span> and <span style="font-weight: bold"><a href="/download.jsp">Download</a></span>). In total, we have generated billions of entries of functional annotations, which can be easily accessed in our user-friendly interfaces (<span style="font-weight: bold"><a href="/help.jsp">Help</a></span>). The regulator summary and genomic annotation of R-loop regions will be constantly updated along the research progress of field. You are welcome to contribute to updating R-loop regulators and related literatures (Regulator Updating System on <span style="font-weight: bold"><a href="/rloopRegulator.jsp">Regulator</a></span> page). Any suggestions and feedbacks from you are also welcome (<span style="font-weight: bold"><a href="/contact.jsp">Contact</a></span>). </p> </div> <a href="##"><div id="showIntroduction" onclick="showMoreOrLess()" style="text-decoration: underline; text-align: right; padding-right: 20px; margin-top: -15px;">Show more</div></a> <hr class="cardHr"> </div> <!-- Introduction --> <div class="searchContainer"> <div class="searchLogo"> <ul> <li class="searchLogoText">R-loopBase</li> <li class="searchLogoImg"><img src="/images/icon-rloop-purple-circle-2.png" style="height: 60px;"></li> </ul> </div> <div class="searchForm"> <input id="searchText" type="text" name="" placeholder="e.g. BRCA2 or chr1:154572702-154628593" onkeypress="handle(event)"> <a href="#"><div class="searchItem" href="#" onclick="toGeneList()"> <i>search</i> </div></a> </div> </div> <div class="horizontalMenu"> <!-- horizontal menu --> <ul id="indexNavigator"> <li> <a href="/browser/cgi-bin/hgTracks"> <img src="/images/browser.png"> <div>Browser</div> </a> </li> <li> <a href="/rloopRegulator.jsp"> <img src="/images/regulator.png"> <div>Regulator</div> </a> </li> <li> <a href="https://rloopbase.nju.edu.cn/deepr/tool/model "> <img src="/images/tool.png"> <div>Tool</div> </a> </li> <li> <a href="/download.jsp"> <img src="/images/download.png"> <div>Download</div> </a> </li> <li> <a href="/help.jsp"> <img src="/images/help.png"> <div>Help</div> </a> </li> <li> <a href="/contact.jsp"> <img src="/images/contact.png"> <div>Contact</div> </a> </li> </ul> </div> <!-- horizontal menu --> <div class="twoCardContainer"> <div class="card cardLeft"><!-- News --> <div class="cardTitle"> News </div> <div class="cardContext" id="newsDiv" style="overflow:hidden;clear:both;height:220px"> <ul> <li>2023.10.01 Online of <a href='https://rloopbase.nju.edu.cn/deepr/tool/model '>DeepER</a>, an R-loop prediction tool.</li> <li>2022.02.19 A new <a href="https://doi.org/10.1101/2022.02.18.480986 ">preprint</a> by R-loopBase team.</li> <li>2021.11.18 Published on <a href="https://doi.org/10.1093/nar/gkab1103 ">Nucleic Acids Res</a>.</li> <li>2021.06.20 Official release of R-loopBase v1.0.</li> <li>2021.06.15 Internal evaluation before public release.</li> <li>2021.05.10 Build-up of R-loopBase genome browser.</li> <li>2021.03.31 Data freeze for R-loopBase v1.0.</li> <li>2021.01.18 Launching R-loopBase project.</li> <li>2020.10.10 Systematic evalation of all R-loop mapping technologies.</li> </ul> </div> <a href="##"><div id="showNews" onclick="showMoreOrLess2()" style="text-decoration: underline; text-align: right; padding-right: 20px; margin-top: 4px;">Show more</div></a> <hr class="cardHr"> </div><!-- News --> <div class="card cardRight"> <!-- Publication --> <div class="cardTitle"> Latest Publications </div> <div class="cardContext" id="publicationDiv"> <ul> <li><a style="color: black" href="https://pubmed.ncbi.nlm.nih.gov/38590928/ ">LUC7L3 is a downstream factor of SRSF1 and prevents genomic instability.</a> Cell Insight. 2024.</li> <li><a style="color: black" href="https://pubmed.ncbi.nlm.nih.gov/38677845/ ">Smartphone-based device for rapid and single-step detection of piRNA-651 using anti-DNA:RNA hybrid antibody and enzymatic signal amplification.</a> Anal Chim Acta. 2024.</li> <li><a style="color: black" href="https://pubmed.ncbi.nlm.nih.gov/38609257/ ">Split activator of CRISPR/Cas12a for direct and sensitive detection of microRNA.</a> Anal Chim Acta. 2024.</li> </ul> <div style="width: 100%; text-align: right; margin-top: -4px;"><a href="https://pubmed.ncbi.nlm.nih.gov/?term=%28R-loop%29+OR+%28R-loops%29+OR+%28%22RNA+DNA+hybrid%22%29+OR+%28%22RNA+DNA+hybrids%22%29+OR+%28%22DNA+RNA+hybrid%22%29+OR+%28%22DNA+RNA+hybrids%22%29&sort=pubdate ">More publications in PubMed</a></div> </div> <hr class="cardHr"> </div> <!-- Publication --> </div> <div class="footer"> <div style="background-color: rgb(90,19,92); height: 60px; line-height: 60px; text-align: center; color: white; "> <div style="display: inline-block; height: 20px; line-height: 20px; margin-top: 15px; margin-bottom: 4px;">© 2020-2025 NANJING UNIVERSITY. ALL RIGHTS RESERVED. </div> <div style="height: 20px; line-height: 20px; margin-top: 0px;">CONDITIONS OF USE</div> </div> </div> </div> <!-- container --> </body> </html> <script type="text/javascript" language="JavaScript"> function handle(e){ if(e.keyCode === 13){ e.preventDefault(); // Ensure it is only this code that runs toGeneList(); } } function toGeneList(){ //var type = document.getElementById('searchSelect').value; var type; var value = document.getElementById('searchText').value; if(value==''){ alert("Please input keyword!"); }else if(value.match(/[^a-zA-Z0-9:-]/)){ alert("Only numbers, letters, \":\" and \"-\" are allowed!"); }else{ //top.location = '/geneList.jsp?searchFor=' + type + '&keyword=' + value; if(value.match(/^chr.+:\d+-\d+$/)){ type="location"; }else{ type="symbols"; } top.location = '/rloopList.jsp?searchFor=' + type + '&keyword=' + value; } } function changeLiSize(){ var selectId = document.getElementById("myNavigator"); } function showMoreOrLess(){ var selectId = document.getElementById("showIntroduction"); var selectText = document.getElementById("introductionText"); if(selectId.innerText == "Show more"){ selectText.style.height="auto"; selectId.innerText="Show less"; }else{ selectText.style.height="120px"; selectId.innerText="Show more"; } } function showMoreOrLess2(){ var selectId2 = document.getElementById("showNews"); var selectText2 = document.getElementById("newsDiv"); if(selectId2.innerText == "Show more"){ selectText2.style.height="auto"; selectId2.innerText="Show less"; }else{ selectText2.style.height="220px"; selectId2.innerText="Show more"; } } var publicationDivHeight = document.getElementById('publicationDiv').clientHeight; </script>
最新发布
07-29
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> <html> <head> <!-- 页面meta --> <meta charset="utf-8"> <title>书虫补给站</title> <link rel="stylesheet" href="${pageContext.request.contextPath}/css/bootstrap.css"> <link rel="stylesheet" href="${pageContext.request.contextPath}/css/AdminLTE.css"> <link rel="stylesheet" href="${pageContext.request.contextPath}/css/_all-skins.min.css"> <script src="${pageContext.request.contextPath}/js/jquery.min.js"></script> <script src="${pageContext.request.contextPath}/js/bootstrap.js"></script> <script src="${pageContext.request.contextPath}/js/app.js"></script> <script type="text/javascript"> function SetIFrameHeight() { var iframeid = document.getElementById("iframe"); //iframe id if (document.getElementById) { iframeid.height = document.documentElement.clientHeight; } } </script> </head> <body class="hold-transition skin-purple sidebar-mini"> <div class="wrapper"> <!-- 页面头部 --> <header class="main-header"> <!-- Logo --> <a href="${pageContext.request.contextPath}/admin/index.jsp" class="logo"> <!-- mini logo for sidebar mini 50x50 pixels --> <span class="logo-mini"><b>智阅云联</b></span> <!-- logo for regular state and mobile devices --> <span class="logo-lg"><b>书虫补给站</b></span> </a> <!-- Header Navbar: style can be found in header.less --> <nav class="navbar navbar-static-top"> <nav class="navbar navbar-static-top"> <div class="navbar-custom-menu"> <ul class="nav navbar-nav"> <li class="dropdown user user-menu"> <a > <img src="${pageContext.request.contextPath}/img/user1.jpg" class="user-image" alt="User Image"> <span class="hidden-xs">${USER_SESSION.name}</span> </a> </li> <li class="dropdown user user-menu"> <a href="${pageContext.request.contextPath}/userServlet?method=logout"> <span class="hidden-xs">注销用户</span> </a> </li> </ul> </div> </nav> </nav> </header> <!-- 页面头部 /--> <!-- 导航侧栏 --> <aside class="main-sidebar"> <!-- sidebar: style can be found in sidebar.less --> <section class="sidebar"> <!-- /.search form --> <!-- sidebar menu: : style can be found in sidebar.less --> <ul class="sidebar-menu"> <li id="admin-index"> <a href="${pageContext.request.contextPath}/admin/index.jsp"> <i class="fa fa-dashboard"></i> <span><b>新书推荐</b></span> </a> </li> <li> <a href="${pageContext.request.contextPath}/bookServlet?method=search" target="iframe"> <i class="fa fa-circle-o"></i> <span><b>图书借阅</b></span> </a> </li> <li> <a href="${pageContext.request.contextPath}/bookServlet?method=searchBorrowed" target="iframe"> <i class="fa fa-circle-o"></i> <span><b>当前借阅</b></span> </a> </li> <li> <a href="${pageContext.request.contextPath}/recordServlet?method=searchRecords" target="iframe"> <i class="fa fa-circle-o"></i> <span><b>借阅记录</b></span> </a> </li> </ul> </section> <!-- /.sidebar --> </aside> <!-- 导航侧栏 /--> <!-- 内容区域 --> <div class="content-wrapper"> <iframe width="100%" id="iframe" name="iframe" onload="SetIFrameHeight()" frameborder="0" src="${pageContext.request.contextPath}/bookServlet?method=selectNewbooks"></iframe> </div> </div> </body> </html>帮我优化一下这段代码
06-19
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值