日期:2014-05-18 浏览次数:20696 次
function isLogin(obj,url){ AddHint.getSessionUser(function(info){ if(info==false){ alert('您未登录或者登陆时间过长,请先登录再操作.'); }else{ alert("1"); obj.target="_top"; obj.href=url; //window.open(url,"_black"); alert("2"); } } ); }
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Insert title here</title> <script type='text/javascript' src='dwr/interface/Test.js'></script> <script type='text/javascript' src='dwr/engine.js'></script> <script type='text/javascript' src='dwr/util.js'></script> <script> function isLogin(obj,urll){ //奇数表示没登录,偶数表示登录 var n=dwr.util.getValue("num"); Test.hello(n,function(flag){ if(flag==false) alert('您未登录或者登陆时间过长,请先登录再操作.'); else { window.location.href=urll; } }); } </script> </head> <body> <form> <input type="text" name="num"/> <a href="javascript:void(0)" target="_top" onclick="isLogin(this,'ttt.html')">账户充值</a> </form> </body> </html>