根据用户输入的Email跳转到相应的邮箱登录页面,根据邮箱的域名跳转到相应的登录页面的代码 ,根据Email跳转到相应的邮箱登录页面
//功能:根据用户输入的Email跳转到相应的电子邮箱首页 function gotoEmail($mail){ $t=$mail.split('@')[1]; $t=$t.toLowerCase(); if($t=='163.com'){ return 'mail.163.com'; }else if($t=='vip.163.com'){ return 'vip.163.com'; }else if($t=='126.com'){ return 'mail.126.com'; }else if($t=='qq.com'||$t=='vip.qq.com'||$t=='foxmail.com'){ return 'mail.qq.com'; }else if($t=='gmail.com'){ return 'mail.google.com'; }else if($t=='sohu.com'){ return 'mail.sohu.com'; }else if($t=='tom.com'){ return 'mail.tom.com'; }else if($t=='vip.sina.com'){ return 'vip.sina.com'; }else if($t=='sina.com.cn'||$t=='sina.com'){ return 'mail.sina.com.cn'; }else if($t=='tom.com'){ return 'mail.tom.com'; }else if($t=='yahoo.com.cn'||$t=='yahoo.cn'){ return 'mail.cn.yahoo.com'; }else if($t=='tom.com'){ return 'mail.tom.com'; }else if($t=='yeah.net'){ return 'www.yeah.net'; }else if($t=='21cn.com'){ return 'mail.21cn.com'; }else if($t=='hotmail.com'){ return 'www.hotmail.com'; }else if($t=='sogou.com'){ return 'mail.sogou.com'; }else if($t=='188.com'){ return 'www.188.com'; }else if($t=='139.com'){ return 'mail.10086.cn'; }else if($t=='189.cn'){ return 'webmail15.189.cn/webmail'; }else if($t=='wo.com.cn'){ return 'mail.wo.com.cn/smsmail'; }else if($t=='139.com'){ return 'mail.10086.cn'; }else { return ''; } };
<script type="text/javascript"> var hash={ 'qq.com': 'http://mail.qq.com', 'gmail.com': 'http://mail.google.com', 'sina.com': 'http://mail.sina.com.cn', '163.com': 'http://mail.163.com', '126.com': 'http://mail.126.com', 'yeah.net': 'http://www.yeah.net/', 'sohu.com': 'http://mail.sohu.com/', 'tom.com': 'http://mail.tom.com/', 'sogou.com': 'http://mail.sogou.com/', '139.com': 'http://mail.10086.cn/', 'hotmail.com': 'http://www.hotmail.com', 'live.com': 'http://login.live.com/', 'live.cn': 'http://login.live.cn/', 'live.com.cn': 'http://login.live.com.cn', '189.com': 'http://webmail16.189.cn/webmail/', 'yahoo.com.cn': 'http://mail.cn.yahoo.com/', 'yahoo.cn': 'http://mail.cn.yahoo.com/', 'eyou.com': 'http://www.eyou.com/', '21cn.com': 'http://mail.21cn.com/', '188.com': 'http://www.188.com/', 'foxmail.coom': 'http://www.foxmail.com' }; $(function(){ $(".mail").each(function() { var url = $(this).text().split('@')[1]; for (var j in hash){ $(this).attr("href", hash[url]); } }); }) </script>
<form id="emailForm" action="mail.qq.com" method="get" target="_blank"> <input type="hidden" id="isHidden" value="yiwo"/> </form> function(){$("#emailForm").attr( "action", "http://"+gotoEmail($("#regEmail").val()));$("#emailForm").submit(); window.location.href="index.action"; }