国内流行的内容管理系统(CMS)多端全媒体解决方案 https://www.dedebiz.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 line
936B

  1. //建议采用现代浏览器内置的fetch替换现有的webajax.js
  2. function $DE(id) {
  3. return document.getElementById(id);
  4. }
  5. //读写cookie函数
  6. function GetCookie(c_name)
  7. {
  8. if (document.cookie.length > 0)
  9. {
  10. c_start = document.cookie.indexOf(c_name + "=")
  11. if (c_start != -1)
  12. {
  13. c_start = c_start + c_name.length + 1;
  14. c_end = document.cookie.indexOf(";",c_start);
  15. if (c_end == -1)
  16. {
  17. c_end = document.cookie.length;
  18. }
  19. return unescape(document.cookie.substring(c_start,c_end));
  20. }
  21. }
  22. return null
  23. }
  24. function SetCookie(c_name,value,expiredays)
  25. {
  26. var exdate = new Date();
  27. exdate.setDate(exdate.getDate() + expiredays);
  28. document.cookie = c_name + "=" +escape(value) + ((expiredays == null) ? "" : ";expires=" + exdate.toGMTString()); //使设置的有效时间正确。增加toGMTString()
  29. }