做的一个网站有个搜索功能,如果没有搜索到信息的话,返回到index.jsp页面,并且弹出qq信息框, 可是它显示的效果是不返回index.jsp页面了 直接在父窗口打开了http://b4.qq.com/webc.htm?new=0&sid=4008269999&eid=&o=&q=7&from=qqwpa这个页面 ,<s:if test="#request.searchlist.list.size()==0">没有您要找的信息!
<a id="go_title ">
<script>
var time = 0;
function gotoBbsIndex() {
time++;
if (time == 4) {
document.location.href = "index.jsp ";
}
document.getElementById("go_title ").innerHTML = (4 - time)+ "秒后自动打开客服QQ";
}
window.setInterval("gotoBbsIndex() ", 1000);
</script>
</a>
<% response.setHeader("refresh","3;URL=http://wpa.qq.com/msgrd?v=3&uin=4008269999&site=qq&menu=yes") ;%>
</s:if>求指教!!!!!
<a id="go_title ">
<script>
var time = 0;
function gotoBbsIndex() {
time++;
if (time == 4) {
document.location.href = "index.jsp ";
}
document.getElementById("go_title ").innerHTML = (4 - time)+ "秒后自动打开客服QQ";
}
window.setInterval("gotoBbsIndex() ", 1000);
</script>
</a>
<% response.setHeader("refresh","3;URL=http://wpa.qq.com/msgrd?v=3&uin=4008269999&site=qq&menu=yes") ;%>
</s:if>求指教!!!!!
解决方案 »
- 急!求java上传图片代码!
- 共享今天面试遇见的两个JavaEE面试题
- Hibernate 映射文件可以不建立表关系吗?
- 现在网页编程哪种语言比较流行,发展有前途,我刚学过JAVA ,只是初学
- JSP页面如何大量取得客户端的数据。
- 收集:实现分页的解决方案~~~~~~~~~~~~~~~
- jsp页面如何转换成html页面呈现到客户端
- !!!!高手请进,全文检索技术如何实现?(100)
- 简单问题!Indexof(value,int)到底是怎么回事?
- 这是什么地方错了?
- log4j输出路径的问题
- 急!急!bugzilla 用户注册报错,Couldn't connect to mail.163.com
这句代码执行没好像应该写成window.location.href啊!!!给忘了,location应该在window下!
setInterval(function(){
if (time == 4) {
self.location = "index.jsp ";
}
document.getElementById("go_title ").innerHTML = (4 - time)+ "秒后自动打开客服QQ";
}
time++; }, 1000);
}
貌似判断time==4这里有问题
那你做个判断就行了啊,如果返回的的数据为null:
window.onload =function(){
if(data==null){
setTimeout(........){}
}
}