国内流行的内容管理系统(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.

26 lines
912B

  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. c_start = document.cookie.indexOf(c_name + "=")
  10. if (c_start != -1) {
  11. c_start = c_start + c_name.length + 1;
  12. c_end = document.cookie.indexOf(";",c_start);
  13. if (c_end == -1) {
  14. c_end = document.cookie.length;
  15. }
  16. return unescape(document.cookie.substring(c_start,c_end));
  17. }
  18. }
  19. return null
  20. }
  21. function SetCookie(c_name,value,expiredays)
  22. {
  23. var exdate = new Date();
  24. exdate.setDate(exdate.getDate() + expiredays);
  25. document.cookie = c_name + "=" +escape(value) + ((expiredays == null) ? "" : ";expires=" + exdate.toGMTString()); //使设置的有效时间正确。增加toGMTString()
  26. }