1234567891011121314151617181920212223242526272829303132 |
- function RootPath() {
- var strFullPath = window.document.location.href;
- var strPath = window.document.location.pathname;
- var pos = strFullPath.indexOf(strPath);
- var prePath = strFullPath.substring(0, pos);
- var postPath = strPath.substring(0, strPath.substr(1).indexOf('/') + 1);
- //return (prePath + postPath);如果发布IIS,有虚假目录用用这句
- return (prePath);
- }
- function AjaxJson(url, postData, callBack) {
- $.ajax({
- url: RootPath() + url,
- type: "post",
- //contentType:"application/json",
- data: postData,
- dataType: "json",
- async: false,
- success: function (data) {
- if (data.Code == "-1") {
- //Loading(false);
- alertDialog(data.Message, -1);
- } else {
- //Loading(false);
- callBack(data);
- }
- },
- error: function (data) {
- //Loading(false);
- alertDialog(data.responseText, -1);
- }
- });
- }
|