gis.superMap.iServer 1020 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. var gis = gis || {};
  2. gis.server = function() {
  3. };
  4. gis.server.jsonAjax= function(obj,exeJson){
  5. var ajaxInfo={
  6. type : 'post',
  7. dataType : 'json',
  8. //contentType : 'application/json;charset=utf-8',
  9. //timeout : 10000, //超时时间设置,单位毫秒
  10. cache : false,// 不从缓存中去数据
  11. async : true,
  12. //url : obj.url,
  13. //data : JSON.stringify(jsondate),
  14. //headers:headinfo,
  15. success : function(data) {
  16. if(exeJson){
  17. exeJson(data);
  18. }
  19. },
  20. error : function(jqXHR, textStatus, errorThrown) {
  21. //alert(jqXHR.responseText);
  22. }
  23. };
  24. ajaxInfo.url=obj.url;
  25. ajaxInfo.data=obj.data||{};
  26. if(typeof(obj.async)!="undefined"){
  27. ajaxInfo.async=obj.async
  28. }
  29. if(typeof(obj.contentType)!="undefined"){
  30. //alert(obj.contentType);
  31. ajaxInfo.contentType=obj.contentType;
  32. }
  33. //alert(ajaxInfo);
  34. $.ajax(ajaxInfo);
  35. }
  36. gis.server.checking = function() {
  37. alert();
  38. };
  39. $(document).ready(function() {
  40. //gis.server.checking();
  41. });