$(document).ready(function(){ if(sso.key != '' && typeof(sso.key) != 'undefined' && sso.key != '-1' && sso.sid !='' && typeof(sso.sid) != 'undefined' && sso.sid != '-1') { //已在別站登入 var back_url = encodeURIComponent(window.location.href); window.location.href='http://www.yubeauty.com/valid_key.php?key='+sso.key+'&sid='+sso.sid+'&back_url='+back_url; }else if(sso.key == '-1' || sso.sid == '-1'){ window.location.href='http://www.yubeauty.com/member/logout.php'; } });