猿问

关于下面语句中,jsp中target="main"的意思,不是很理解!

<table border="0" align="center" cellpadding="0" cellspacing="5">
<tr>
<td>
<c:choose>
<%String backurl=(String)request.getAttribute("BackURL");
if(backurl.length()>3){
String ext=backurl.substring(backurl.length()-3);
if(ext.equalsIgnoreCase("jsp")){ %>
<a href="javascript:location.href='${BackURL}'" target="main"> <img
src="<%=refpath%>/images/btn_fanhui.png" width="69"
height="23" border="0" align="middle"> </a>
<%}else{%>

<a href="javascript:location.href='${BackURL}'"> <img
src="<%=refpath%>/images/btn_fanhui.png" width="69"
height="23" border="0" align="middle"> </a>

<%}
} %>
</c:choose>
</td>
</tr>
</table>
麻烦高手解释下这段代码那里的main会跳到哪里去

慕田峪9158850
浏览 455回答 3
3回答

慕婉清6462132

<a&nbsp;target="main"&nbsp;href="#">点我试试</a><iframe&nbsp;name="main"&nbsp;src=""&nbsp;/>原本<a>被点击后, 会显示的内容, 将显示到<iframe>这个页内框架中!&nbsp;

aluckdog

你的JSP页面应该是个框架结构的页面,框架中应该有个叫main的模块,就是在那个模块中展示加载内容

一只甜甜圈

<table border="0" align="center" cellpadding="0" cellspacing="5"><tr><td><c:choose><%String backurl=(String)request.getAttribute("BackURL");if(backurl.length()>3){String ext=backurl.substring(backurl.length()-3);if(ext.equalsIgnoreCase("jsp")){ %><a href="javascript:location.href='${BackURL}'" target="main"> <imgsrc="<%=refpath%>/images/btn_fanhui.png" width="69"height="23" border="0" align="middle"> </a><%}else{%><a href="javascript:location.href='${BackURL}'"> <imgsrc="<%=refpath%>/images/btn_fanhui.png" width="69"height="23" border="0" align="middle"> </a><%}} %></c:choose></td></tr></table>
随时随地看视频慕课网APP
我要回答