type: 'post',
url: getContentPath() + '/zmanaly/readTotal',
data: {"type":type}, //此处输入传入后台的值,“”里面则是后台用哪个接收
dataType:'text',
async:false,
success: function(data){
}
}
})
使用cookie即可。
<!DOCTYPE HTML><html lang="en-US">
<head>
<meta charset="UTF-8">
<meta name="keywords" content="白菜编辑部">
<title>白菜编辑部</title>
<style type="text/css">
</style>
<script type="text/javascript">
function readCookie (name)
{
var cookieValue = ""
var search = name + "="
if (document.cookie.length > 0)
{
offset = document.cookie.indexOf (search)
if (offset != -1)
{
offset += search.length
end = document.cookie.indexOf ("", offset)
if (end == -1)
end = document.cookie.length
cookieValue = unescape (document.cookie.substring (offset, end))
}
}
return cookieValue
}
function writeCookie (name, value, hours)
{
var expire = ""
if (hours != null)
{
expire = new Date ((new Date ()).getTime () + hours * 3600000)
expire = " expires=" + expire.toGMTString ()
}
document.cookie = name + "=" + escape (value) + expire
}
writeCookie ("myCookie", "my name", 24)
alert (readCookie ("myCookie"))
</script>
</head>
<body>
</body>
</html>
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)