javascript条款和条件脚本 [英] javascript terms and conditions script
问题描述
大家好,请各位大家将这些代码组合成一个并使其正常工作
< SCRIPT LANGUAGE =JavaScript>
<! -
函数GetCookie(名称){
var arg = name +=;
var alen = arg.length ;
var clen = document.cookie.length;
var i = 0;
while(i< clen){
var j = i + alen;
if(document.cookie.substring(i,j)== arg)
返回here;
i = document.cookie.indexOf(,i)+1;
if(i == 0)break;
}
返回null;
}
var visit = GetCookie(ZZZZZ);
if(visit == null) {
alert(你的消息在这里,你只能看到它一次!);
var expire = new Date( );
expire = new Date(expire.getTime()+ 7776000000);
document.cookie =ZZZZZ = here; expires =+ expire;
}
// - >
< / SCRIPT>
代码2
var answer = confirm(请点击确定继续加载我的页面,或取消即可导向雅虎网站。)
if(!answer)
window.location =http://www.yahoo.com/
Hi could you please guys combine these codes into one and make it work
<SCRIPT LANGUAGE="JavaScript">
<!--
function GetCookie(name) {
var arg=name+"=";
var alen=arg.length;
var clen=document.cookie.length;
var i=0;
while (i<clen) {
var j=i+alen;
if (document.cookie.substring(i,j)==arg)
return "here";
i=document.cookie.indexOf(" ",i)+1;
if (i==0) break;
}
return null;
}
var visit=GetCookie("ZZZZZ");
if (visit==null){
alert("Your Message Goes here and you only get to see it once!");
var expire=new Date();
expire=new Date(expire.getTime()+7776000000);
document.cookie="ZZZZZ=here; expires="+expire;
}
// -->
</SCRIPT>
code 2
var answer = confirm ("Please click on OK to continue loading my page, or CANCEL to be directed to the Yahoo site.")
if (!answer)
window.location="http://www.yahoo.com/"
推荐答案
这是适合您的可能解决方案之一: http://www.queness.com/post/77/simple-jquery-modal-window-tutorial [ ^ ]。
你需要使用jQuery,一个JavaScript库。请参阅:
http://en.wikipedia.org/wiki/JQuery [< a href =http://en.wikipedia.org/wiki/JQuerytarget =_ blanktitle =New Window> ^ ],
http://jquery.com/ [ ^ ],
http://learn.jquery.com [ ^ ],
从这里开始:http://learn.jquery.com/about-jquery/how-jquery-works/ [ ^ ]。
-SA
This is one of the possible solutions which should suit you: http://www.queness.com/post/77/simple-jquery-modal-window-tutorial[^].
You will need to use jQuery, a JavaScript library. Please see:
http://en.wikipedia.org/wiki/JQuery[^],
http://jquery.com/[^],
http://learn.jquery.com[^],
start here: http://learn.jquery.com/about-jquery/how-jquery-works/[^].
—SA
这篇关于javascript条款和条件脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!