<a href="javascript:detail(<%=rec_id%>);" class="ccc">修改<span>&

宝宝妈妈2023-04-03  42

<a href="javascript:detail(‘<%=rec_id%>’)" class="ccc">修改</a>应该改成这样把

理解:

1.首先<a></a>是超链接标签,这个很好理解

2. href="javascript:detail(<%=rec_id%>)" 这个的意思是链接是执行js里面detail这个方法,即点击“修改”,会去执行detail这个方法

‘<%=rec_id%>’ 这个是在jsp页面嵌入java代码的方法。在这行代码之前应该会有定义rec_id变量值的java代码,也应该是写在<%.....%>里的。这里表示取rec_id的值。

如<%String rec_id =(String)request.getParameter("test")%>

这样你就取到了rec_id的值,然后当做detail函数执行的参数。

3.class="ccc" 这个不用解释了吧,css样式

1._blank <a href="document.html" target="_blank">my document</a>浏览器会另开一个新窗口显示document.html文档

2._parent <a href="document.html" target="_parent">my document</a> 指向父frameset文档

3._self <a href="document.html" target="_self">my document</a> 把文档调入当前页框

4._top <a href="document.html" target="_top">my document</a>去掉所有页框并用document.html取代frameset文档

小技巧1:使别人的页框不能引用你的网页在文件头加:<base target="_top">

小技巧2:在当前页打开连接或做刷新,提交到当前页在文件头加:<base target="_self">

google跟baidu越来越接近,所以优化效果几乎一样


转载请注明原文地址:https://54852.com/read/491184.html