jkcor.js 560 B

1234567891011121314151617181920
  1. // cookie设置
  2. function setCookie(key, val, seconds) {
  3. var date = new Date();
  4. date.setTime(date.getTime() + seconds * 1000);//只能这么写,10表示10秒钟
  5. console.log(key)
  6. console.log(val)
  7. $.cookie(key, val, {expires: date});
  8. }
  9. // 捕捉全局异常弹出
  10. function handleError(msg,url,l)
  11. {
  12. var txt="There was an error on this page.\n\n"
  13. txt+="Error: " + msg + "\n"
  14. txt+="URL: " + url + "\n"
  15. txt+="Line: " + l + "\n\n"
  16. txt+="Click OK to continue.\n\n"
  17. alert(txt)
  18. return true
  19. }
  20. window.onerror = handleError