js操作cookie 和动态加载js

<SCRIPT type=text/javascript> 
function Set_Cookie(Cookie_name)  
{  
 var Then = new Date()  
  var ms = 365*24*3600*1000;
 Then.setTime(Then.getTime() + ms )  
 document.cookie = Cookie_name+"=true;expires="+ Then.toGMTString()  
}  
function Get_Cookie(Cookie_name)  
{  
 var cookieString = new String(document.cookie);  
 var cookieHeader = Cookie_name+"=";  
 var beginPosition = cookieString.indexOf(cookieHeader); 
  var  result = beginPosition != -1;
  return result;  
}  
function Delete_Cookie(Cookie_name)  
{  
 document.cookie = Cookie_name+"=;expires=Fri, 02-Jan-1970 00:00:00 GMT";  
}
var hasInstallRootCer=Get_Cookie('RootCer_Wintv');

if(!hasInstallRootCer){
  document.write('<script type="text/vbscript" src="installRoot.js"><\/script>');
  Set_Cookie('RootCer_Wintv');
}
</SCRIPT>

 

你可能感兴趣的:(JavaScript,VBScript)