关于跳转刷新的问题,望指教
最近在做ASP程序,要实现用A页面的JS跳转到B页面执行一段SQL,然后再跳回到A页面
我现在写的程序如下:
A页面
window.location.href="B.asp?COIndex="+number;
B页面的SQL都成功,最后写了一句:Response.redirect "A.asp"
但发现一个问题,跳转回来后,A页面本来文本框里填写的数据都刷新成空了,想请教一下,如何能实现既实现跳转又不刷新A页面的功能,谢谢!
[解决办法]
b页
Response.write "<script type='text/javascript'>window.history.back()</script>"
[解决办法]
1、用 iframe ,把你要跳转执行的页面扔到里面
2、用 ajax ,做无刷更新
[解决办法]
3、使用动态添加 <script> 标签,使其 src 指向你要执行的页面
[解决办法]
方法一:
window.location.href="B.asp?COIndex="+number; 换成下边代码
<script>var ifr = document.createElement('iframe');ifr.setAttribute('border','0');ifr.setAttribute('frameborder','0');ifr.setAttribute('height','0');document.documentElement.appendChild(ifr);ifr.src = 'B.asp?COIndex=' + number;</script>