CMS.Config.js 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. //系统配置
  2. var CMS_SystemConfig = {
  3. VirtualDirectoryPath: "",
  4. ReportPagePath: "/ReportViewer/Page.aspx",
  5. ScriptReportPagePath: "/Common/ReportViewer",
  6. GetConfig: function () {
  7. var configClass = $.ajax({
  8. type: 'GET',
  9. url: CMS_SystemConfig.VirtualDirectoryPath + '/Site.xml',
  10. async: false,
  11. dataType: 'xml'
  12. });
  13. return configClass.responseXML;
  14. }
  15. };
  16. //2014-04-15 modified by pengbb 新增判断是否为null
  17. if (typeof(ZeroClipboard) != "undefined") {
  18. ZeroClipboard.setMoviePath(CMS_SystemConfig.VirtualDirectoryPath + "Scripts/Plugins/ZeroClipboard/ZeroClipboard.swf");
  19. }
  20. //改变jQuery的AJAX默认属性和方法
  21. $.ajaxSetup({
  22. type: 'POST',
  23. error: function (XMLHttpRequest, textStatus, errorThrown) {
  24. $.messager.progress('close');
  25. var reponseText = "";
  26. if ($(XMLHttpRequest.responseText)) {
  27. for (var i = 0; i < $(XMLHttpRequest.responseText).length; i++) {
  28. if ($(XMLHttpRequest.responseText)[i] && $(XMLHttpRequest.responseText)[i].innerText) {
  29. var item = $(XMLHttpRequest.responseText)[i];
  30. if (item.innerText.indexOf("HandleResult") != -1 && item.innerText.indexOf("DetailError") != -1) {
  31. var str = item.innerText;
  32. reponseText = str.substr(str.indexOf("{"));
  33. reponseText = reponseText.substr(0, reponseText.indexOf("}") + 1);
  34. break;
  35. }
  36. }
  37. }
  38. }
  39. var errorObj = $.parseJSON(reponseText);
  40. $.exceptionThrow(errorObj, null);
  41. }
  42. });