Brak opisu

huayi.load.js 1.9KB

123456789101112131415161718192021222324252627282930313233343536
  1. var huayi = {};
  2. //huayi.local ={
  3. // curWwwPath: window.document.location.href,
  4. // pathName : window.document.location.pathname,
  5. // hostPath: window.document.location.href.substring(0, window.document.location.href.indexOf(window.document.location.pathname)) + window.document.location.pathname.substring(0, window.document.location.pathname.substr(1).indexOf('/') + 1)
  6. //};
  7. function GetPath() {
  8. var curWwwPath = window.document.location.href;
  9. //为了便于前端测试,便宜行事的解决方案
  10. if (curWwwPath.indexOf("127.0.0.1")>0) {
  11. var pathName = window.document.location.pathname;
  12. var pos = curWwwPath.indexOf(pathName);
  13. var localhostPaht = curWwwPath.substring(0, pos);
  14. var projectName = pathName.substring(0, pathName.substr(1).indexOf('/') + 1);
  15. var realPath = localhostPaht + projectName;
  16. return realPath;
  17. }
  18. else {
  19. return '';
  20. }
  21. }
  22. var hostPath = GetPath();
  23. document.write(" <script language=\"javascript\" type=\"text/javascript\" src=\"" + hostPath + "/js/jquery.min.js\"></script>");
  24. // document.write(" <script language=\"javascript\" type=\"text/javascript\" src=\"" + hostPath + "/js/jquery.cookie.js\"></script>");
  25. // document.write(" <script language=\"javascript\" type=\"text/javascript\" src=\"" + hostPath + "/js/bootstrap.min.js\"></script>");
  26. // document.write(" <script language=\"javascript\" type=\"text/javascript\" src=\"" + hostPath + "/js/bootstrap-table.min.js\"></script>");
  27. // document.write(" <script language=\"javascript\" type=\"text/javascript\" src=\"" + hostPath + "/js/bootstrap-table-zh-CN.min.js\"></script>");
  28. // document.write(" <script language=\"javascript\" type=\"text/javascript\" src=\"" + hostPath + "/css/layer/layer.js\"></script>");
  29. document.write(" <script language=\"javascript\" type=\"text/javascript\" src=\"" + hostPath + "/Script/Common/huayi.http.js\"></script>");