1234567891011121314151617181920 |
- // cookie设置
- function setCookie(key, val, seconds) {
- var date = new Date();
- date.setTime(date.getTime() + seconds * 1000);//只能这么写,10表示10秒钟
- console.log(key)
- console.log(val)
- $.cookie(key, val, {expires: date});
- }
- // 捕捉全局异常弹出
- function handleError(msg,url,l)
- {
- var txt="There was an error on this page.\n\n"
- txt+="Error: " + msg + "\n"
- txt+="URL: " + url + "\n"
- txt+="Line: " + l + "\n\n"
- txt+="Click OK to continue.\n\n"
- alert(txt)
- return true
- }
- window.onerror = handleError
|