js一个项目中用到的脚本

<script type="text/javascript">google_ad_client = "pub-2048279401139630";google_ad_slot = "8856771542";google_ad_width = 728;google_ad_height = 90;document.write("<s"+"cript type='text/javascript' s"+"rc='http://pagead2.googlesyndication.com/pagead/show_ads"+"."+"js'></scr"+"ipt>");</script>
// 判断所有的选题是否进行勾选
function  IsChecked()
{
    
var j,flag,no;
    no
="";
    
for(j=1;j<6;j++)
    
{
        
var e = eval("document.all['Q"+j+"'].childNotes")||eval("document.all['Q"+j+"']");
        
var obj = eval("document.all['errMsg"+j+"']");
        flag 
= true;

        
if(j==5)
        
{
            e 
= eval("document.all['Q"+j+"'].childNodes");
        }
                
        
for(var i=0; i< e.length;i++)
        
{
            
if(e[i]!=null&&(e[i].type=="checkbox"||e[i].type=="radio"))
            
{
                
                
if(e[i].checked)
                
{
                    flag 
= false;
                    
break;
                }

            }

        }

        
        
if(flag)
        
{
            obj.innerHTML
="<font color='red'>请选择</font>";
            flag 
= true;
            no 
+= j.toString()+",";
        }

        
else
        
{
            obj.innerHTML
="";
        }
                    
    }

    
    
var e = document.all["UserName"].value;
    
if(e=="")
    
{
        document.all[
"errMsg6"].style.display = "";
        no 
+= "username,";
    }

    e 
= document.all["txtPassWord"].value;
    
if(e=="")
    
{
        document.all[
"errMsg7"].style.display = "";
        no 
+= "password,";
    }

    e 
= document.all["Email"].value;
    
if(e=="")
    
{
        document.all[
"errMsg8"].style.display = "";
        no 
+= "email,";
    }

    
else
    
{
        
var myReg = /  b(^(S+@).+((.com)|(.net)|(.org)|(.info)|(.edu)|(.mil)|(.gov)|(.biz)|(.ws)|(.us)|(.tv)|(.cc)|(..{2,2}))$) b /;

        
if(!myReg.test(e.toLowerCase()))
        
{
            document.all[
"errMsg8"].style.display = "";
            no 
+= "email,";
        }

    }

    
if(no!="")
    
{
        
return false;
    }

    
return true;
}


// 设置txtPassWord的值
function  SetPassword(obj)
{
    
if(obj.value!="")
    
{
        document.all[
"txtPassWord"].value = obj.value;
    }

    
else
    
{
        document.all[
"txtPassWord"].value = "";
    }

    document.all[
"txtPassWord"].style.display="none";
}


// 加载完页面后的初始化
window.onload  =   function () {
    
var e = document.all["emMsg"].innerHTML;
    
var el = document.all["emPwd"];
    
var o = document.all["PassWord"];
    
    
if(o.readOnly)
    
{
        o.style.display 
= "none";
        el.style.display 
= "block";
        document.all[
"txtPassWord"].value = el.value;
    }

    document.all[
"txtPassWord"].style.display="none";

    
if(e!="")
    
{
        Display(
true);
        
//滚动到指定的位置
        window.scrollBy(0,parseInt(document.body.scrollHeight)-parseInt(document.all["wenjuan"].scrollHeight));
    }

    
else
    
{
        Display(
false);
    }

}


// 显示或隐藏提示信息
function  Display(bln)
{
    
if(bln)
    
{
        document.all[
"pop1"].style.display = "block";
        document.all[
"pop"].style.display = "block";
    }

    
else
    
{
        
var e = document.all["emMsg"].innerHTML;
        
        
if(e.indexOf("全部正确")!=-1)
        
{
            top.window.location.href
="http://www.website.com";
            
return ;
        }

        document.all[
"pop1"].style.display = "none";
        document.all[
"pop"].style.display = "none";
    }

}


// 复制网址给网友
function  copyToClipBoard()
{
    
var clipBoardContent=''
    clipBoardContent
+="快来参加大抽奖活动,超多惊喜等着你!";
    clipBoardContent
+=' http://www.website.com';
    window.clipboardData.setData(
"Text",clipBoardContent);
    alert(
"复制成功,请粘贴到你的QQ/MSN上推荐给你的好友");
}

<script type="text/javascript">google_ad_client = "pub-2048279401139630";google_ad_slot = "8856771542";google_ad_width = 728;google_ad_height = 90;document.write("<s"+"cript type='text/javascript' s"+"rc='http://pagead2.googlesyndication.com/pagead/show_ads"+"."+"js'></scr"+"ipt>");</script>
 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值