
js
scchary
这个作者很懒,什么都没留下…
展开
-
js监听当前页面刷新的事件
window.onbeforeunload = function (e) { e = e || window.event; // For IE and Firefox prior to version 4 if (e) { setCookie('snsnbgg','1',5); } // Fo原创 2014-12-17 15:37:58 · 13694 阅读 · 2 评论 -
js操作cookie
穿转载自http://www.w3cschool.cc/js/js-cookies.html//设置cookie,参数依次为,cookie键值,cookie值,cookie时间(代表天数) function setCookie(cname,cvalue,exdays){ var d = new Date(); d.setTime(d.getTime()+(exdays*24*6转载 2014-12-06 15:02:52 · 590 阅读 · 0 评论 -
js更新缓存页面(发送http请求)
var url_index=0;var interval='';function get_html (wirite_url) { $.ajax({ url: wirite_url[url_index].url, cache:false, async:false, timeout:1000*10, type原创 2015-01-04 09:51:37 · 1568 阅读 · 0 评论 -
js检测客户端类型并跳转
var bForcepc = fGetQuery("dv") =="pc"; function fBrowserRedirect(){ var sUserAgent = navigator.userAgent.toLowerCase(); var bIsIpad = sUserAgent.match(/ipad/i) =="ipad"; var翻译 2015-03-13 17:02:32 · 818 阅读 · 0 评论