如: ------------------------------------------
A页面 | B页面|
__________________________________________
这下面就是显示区域
也就是 点击 A页面时 下面显示的就是A页面的内容.
如果是 点击 B页面时 下面显示的就是B页面的内容 .
求助啊 .
请大家给出原码
A页面 | B页面|
__________________________________________
这下面就是显示区域
也就是 点击 A页面时 下面显示的就是A页面的内容.
如果是 点击 B页面时 下面显示的就是B页面的内容 .
求助啊 .
请大家给出原码
解决方案 »
- 为什么在tomcat服务器上运行无效
- 静态页面实现分页,数据为动态后台一次索取
- Eclipse 启动tomcat时报错:java.io.UnsupportedEncodingException: GBK
- 常见问题
- 开发中图片名称是中文民,在页面中显示不了 ,怎么回事
- 一个关于dwr3.0的问题
- 交男性程序员朋友 (java c++) 不诚勿扰
- 企业短期招聘js高手
- javamail发邮件错误信息:javax.mail.AuthenticationFailedException
- 请高手看看下面的程序有没有错误
- 求教高手关于Unknown Source问题
- 完整jsp程序连接数据库出错,懂得进来一下啊
<a href="a.jsp" target="mainframe"> A页面</a> | <a href="b.jsp" target="mainframe">B页面</a>|
<br>
<br>
<iframe name="mainframe" id="mainframe" width="500" height="500"></iframe>
<head runat="server">
<title>无标题页</title>
</head>
<body>
<style type="text/css">
*{font-size:10pt}
</style>
<form id="form1" runat="server">
<div style="height: 500px">
<script type="text/javascript" >
function
show1(nam)
{ nam1.style.borderBottom='none';
nam1.style.background='none';
nam2.style.borderBottom='1px solid #A8CFF0';
nam2.style.backgroundColor='#E3EFFB';
nam3.style.borderBottom='1px solid #A8CFF0';
nam3.style.backgroundColor='#E3EFFB';
nam4.style.borderBottom='1px solid #A8CFF0';
nam4.style.backgroundColor='#E3EFFB';
nam5.style.borderBottom='1px solid #A8CFF0';
nam5.style.backgroundColor='#E3EFFB';
cplist2.style.display='none';
cplist3.style.display='none';
cplist4.style.display='none';
cplist5.style.display='none';
cplist1.style.display='block'}
function
show2(nam)
{ nam2.style.borderBottom='none';
nam2.style.background='none';
nam1.style.borderBottom='1px solid #A8CFF0';
nam1.style.backgroundColor='#E3EFFB';
nam3.style.borderBottom='1px solid #A8CFF0';
nam3.style.backgroundColor='#E3EFFB';
nam4.style.borderBottom='1px solid #A8CFF0';
nam4.style.backgroundColor='#E3EFFB';
nam5.style.borderBottom='1px solid #A8CFF0';
nam5.style.backgroundColor='#E3EFFB';
cplist1.style.display='none';
cplist3.style.display='none';
cplist4.style.display='none';
cplist5.style.display='none';
cplist2.style.display='block'}
function
show3(nam)
{ nam1.style.borderBottom='1px solid #A8CFF0';
nam1.style.backgroundColor='#E3EFFB';
nam2.style.borderBottom='1px solid #A8CFF0';
nam2.style.backgroundColor='#E3EFFB';
nam3.style.borderBottom='none';
nam3.style.background='none';
nam4.style.borderBottom='1px solid #A8CFF0';
nam4.style.backgroundColor='#E3EFFB';
nam5.style.borderBottom='1px solid #A8CFF0';
nam5.style.backgroundColor='#E3EFFB';
cplist1.style.display='none';
cplist2.style.display='none';
cplist4.style.display='none';
cplist5.style.display='none';
cplist3.style.display='block'}
function
show4(nam)
{ nam1.style.borderBottom='1px solid #A8CFF0';
nam1.style.backgroundColor='#E3EFFB';
nam2.style.borderBottom='1px solid #A8CFF0';
nam2.style.backgroundColor='#E3EFFB';
nam3.style.borderBottom='1px solid #A8CFF0';
nam3.style.backgroundColor='#E3EFFB';
nam4.style.borderBottom='none';
nam4.style.background='none';
nam5.style.borderBottom='1px solid #A8CFF0';
nam5.style.backgroundColor='#E3EFFB';
cplist1.style.display='none';
cplist2.style.display='none';
cplist3.style.display='none';
cplist5.style.display='none';
cplist4.style.display='block'}
function
show5(nam)
{ nam1.style.borderBottom='1px solid #A8CFF0';
nam1.style.backgroundColor='#E3EFFB';
nam2.style.borderBottom='1px solid #A8CFF0';
nam2.style.backgroundColor='#E3EFFB';
nam3.style.borderBottom='1px solid #A8CFF0';
nam3.style.backgroundColor='#E3EFFB';
nam4.style.borderBottom='1px solid #A8CFF0';
nam4.style.backgroundColor='#E3EFFB';
nam5.style.borderBottom='none';
nam5.style.background='none';
cplist1.style.display='none';
cplist2.style.display='none';
cplist3.style.display='none';
cplist4.style.display='none';
cplist5.style.display='block'}
</script>
<table width="750" height="25" border="0" cellpadding="0" cellspacing="0" style="border:1px solid #A8CFF0; border-bottom:none">
<tr>
<td width="20%" align="center" onmouseover="javascript:show1(this)" id="nam1">
<p><A href="chanpin.asp?lx=1" style="color:#000000; text-decoration:none">第一个</A>
</p>
</td>
<td width="20%" align="center" style="border-bottom:1px solid #A8CFF0;border-left:1px solid #A8CFF0;background-color:#E3EFFB;" onmouseover="javascript:show2(this)" id="nam2">
<A href="chanpin.asp?lx=2" style="color:#000000; text-decoration:none">第二个</A>
</td>
<td width="20%" align="center" style="border-bottom:1px solid #A8CFF0;border-left:1px solid #A8CFF0;background-color:#E3EFFB;" onmouseover="javascript:show3(this)" id="nam3">
<A href="chanpin.asp?lx=3" style="color:#000000; text-decoration:none">第3个</A>
</td>
<td width="20%" align="center" style="border-bottom:1px solid #A8CFF0;border-left:1px solid #A8CFF0;background-color:#E3EFFB;" onmouseover="javascript:show4(this)" id="nam4">
<A href="chanpin.asp?lx=4" style="color:#000000; text-decoration:none">第4个</A>
</td>
<td width="20%" align="center" style="border-bottom:1px solid #A8CFF0;border-left:1px solid #A8CFF0;background-color:#E3EFFB;" onmouseover="javascript:show5(this)" id="nam5">
<A href="chanpin.asp?lx=5" style="color:#000000; text-decoration:none">第5个</A>
</td>
</tr>
</table>
<table width="750" height="370" border="0" cellpadding="0" cellspacing="0" style="border:1px solid #A8CFF0; border-top:none; padding-top:10px; border-collapse:collapse">
<tr>
<td>
<!--cplist-->
<div id="cplist1" style="width:100%; height:370px; overflow:hidden">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> 第一个第一个第一个第一个第一个第一个
</td>
</tr>
</table>
<br />
</div>
<div id="cplist2" style="width:100%; height:370px; overflow:hidden; display:none">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> 第二个第二个第二个第二个第二个第二个第二个第二个
</td>
<td valign="top">
</td>
</tr>
</table>
<br />
</div>
<div id="cplist3" style="width:100%; height:370px; overflow:hidden; display:none" >
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> 第3个第3个第3个第3个第3个第3个
</td>
<td valign="top">
</td>
</tr>
</table>
<br />
</div>
<div id="cplist4" style="width:100%; height:370px; overflow:hidden; display:none">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> <asp:GridView ID="GridView4" runat="server">
</asp:GridView>第4个第4个第4个第4个第4个第4个
</td>
<td valign="top">
</td>
</tr>
</table>
<br />
</div>
<div id="cplist5" style="width:100%; height:370px; overflow:hidden; display:none">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> <asp:GridView ID="GridView5" runat="server">
</asp:GridView>第5个第5个第5个第一个第5个第一个
</td>
<td valign="top">
</td>
</tr>
</table>
<br />
</div>
<!--cplist end-->
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
JS做的比较复杂啊,
我只懂得简单的JS复杂的就不懂了
出现问题定位很困难 ,
我想挑个简单点的来处理, 因为这个要的比较急.
能不能详细说下, 我对AJAX没什么研究 最好是原码 这样学习一下比较快,
<ul style="list-style:none; width: 100%">
<li id="ali" style="float: left; width: 50%" onclick="style.display='none'; bli.style.display='inline'; area.style.display='block'; area.innerText='a内容'">A页面</li>
<li id="bli" style="display: none; float: left; width: 50%" onclick="style.display='none'; bli.style.display='inline'; area.style.display='block'; area.innerText='b内容'">B页面</li>
</ul>
<hr style="clear: both" />
<div id="area">显示区域</div>
<ul style="list-style:none; width: 100%">
<li id="ali" style="float: left; width: 50%" onclick="area.style.display='block'; area.innerText='a内容'">A页面</li>
<li id="bli" style="float: left; width: 50%" onclick="area.style.display='block'; area.innerText='b内容'">B页面</li>
</ul>
<hr style="clear: both" />
<div id="area">显示区域</div>
但是我的每个页面里面还得有提交的动作啊. 要提交到SERVLET
这样可以实现吗
我所说的就是 .
点击 A 显示 A页面. A页面中有提交按钮提交A 的内容
点击 B 显示 B页面. B页面中有提交按钮提交B 的内容