js实现第一次打开页面弹出提示


<htmlxmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript" src="http://ztydai.com/js/jquery-1.8.3.min.js">script>
head>
<body>
<div id="first" style="display:none;">第一次打开会显示div>
body>
<script>
window.onload =function(){
var res = document.cookie.indexOf("name");
alert(res);
if(res!=0){
var oDate =new Date();
document.cookie ="name=zheng;";
document.getElementById('first').style.display ='block';
}
}
script>
html>

你可能感兴趣的:(Js,/,jQuery)