<input type="button" value="go" onclick="location.href='http://www.csdn.net'">
解决方案 »
- 急!ActiveXObject 未定义的问题,求大侠解决。
- 谁有好的优化方法,这种写法一点水准都没有
- 急!用window.createPopup(); 弹出了个窗口,在窗口中想引用外部的.js文件,怎么写?
- js全局变量在方法中赋值后返回undefined
- 验证码。。点击后没反映-。-!
- javascript 简单问题,,JS文件引入问题
- 如何在aspx页面中,插入一段代码,当页面调用完毕后,自动触发其中一个按钮。谢谢指教。
- JSON未来发展前景
- 我拷了如下一段代码,为什么在2000下正常,在XP下好象没执行?
- 100分求解,HTML LIST 拖拽的问题,UP 有分
- 高手:如何实现打印??
- 有关时间格式,怎么改变(on line)
=======================
<input type="button" value="go" onclick="location.href='b.htm'">
b页面
=======================
<input type="button" value="go" onclick="location.href='a.htm'">
我的页面只有一个,结构如下:
上面是一个按纽,下面是一个表格,我点击此按纽切换表格数据用CIS图表示,那也是上面那样就可以了吗?
<input type=button value=后退 onclick="window.history.go(-1)">
<input type=button value=前进 onclick="window.history.forward()">
<input type=button value=后退 onclick="window.history.back()">
<input type=button value=后退 onclick="window.history.go(-1)">
<input type=button value=前进 onclick="window.history.forward()">
<input type=button value=后退 onclick="window.history.back()">
方法一:用ASP写(请求后台服务):
<%
type1 = Request("type")
if type1 = "" or type1 = "new" then'显示页面1
%>
<script language=javascript>
function tt1()
{
window.location = "a.asp?type=old"
}
</script>
<input type=button value="显示页面2" onclick=tt1() name=button1>
<%
else'显示页面2
%>
<script language=javascript>
function tt2()
{
window.location = "a.asp?type=new"
}
</script>
<input type=button value="显示页面1" onclick=tt2() name=button2>
<%end if%><%
if type1 = "" or type1 = "new" then'以下用于显示页面1
%><%
else'-----------------------------------------以下用于显示页面2
%><%end if%>很简单的,不懂就问哈。方法2:不用asp页面,这时我们就要用到层了:<script language=javascript>
function go_div1()
{
document.getElementById("div1").style.visibility = "visible"
document.getElementById("div2").style.visibility = "hidden"
}function go_div2()
{
document.getElementById("div2").style.visibility = "visible"
document.getElementById("div1").style.visibility = "hidden"
}
</script><div id = div1
style="BACKGROUND-COLOR: slateblue; HEIGHT: 300px; POSITION: absolute; VISIBILITY: hidden; WIDTH: 300px; heigth: 300px; TOP:100px">
我是第一个页面
</div>
<div id = div2
style="BACKGROUND-COLOR: lightgreen; HEIGHT: 400px; LEFT: 500px; POSITION: absolute; VISIBILITY: hidden; WIDTH: 300px; TOP:100px">
我是第二个页面</div>
<input type=button value="显示页面1" onclick=go_div1()> <input type=button value="显示页面2" onclick=go_div2()>
谢谢大家了~!
我们是用的jsp+sevlet+javaBean模式,用JSP只是做前台页面的东西,不牵涉到sevlet和javabean,所有功能都由后台实现~!
另外问一下:yinwenjie(java入门中) ,在上面的代码中,“我是第一个页面”是不是就是要换成我的第一个页面,我的第一个页面是一个动态的数据表也可以吗?而我的第二个页面是一个gis图啊,也是动态的,那样做可以吗?
{
public A()
{
.......
}
public String cc()
{
return "goog luck!!"
}
..........
}
<div id=div1>
层中的数据是动态生成的,比如:
<jsp:useBean id="tt" class="A" scope="page">
</jsp>
<%=A.c()%>
</div>
这样当我的div可见时,我的"good luck"就可以看见了,你qq是多少??
<a href = "b.html">连接到b</a>
b.html
<a href = "a.html">连接到a</a>
这不成吗?