묻고답하기

xe 1.5.4에서 님께서 정성껏 만들어 주신 myMethodCall.js를 이용해서 json을 정상적으로 사용했는데요.

 

 

myMethodCall.js 내용

 

/**

 * @file MyMethodCall.js

 * @author 바람꽃 (wndflwr@gmail.com)

 * @brief XE에게 ajax 요청을 보낸다. 요청을 보내기 전 반드시 setModule()과 setAct()를 사용해

 * 요청을 보낼 서버의 모듈과 act를 지정하도록 한다.

 * 필요한 변수들은 addElement로 넣고 CDATA 형식의 데이터는 addCDATAElement()를 사용하도록 하자.

 * @returns this

 */

function MyMethodCall(module, act) {

this.module = module;

this.act = act;

this.params = new Array();

this.CDATAparam = new Array();

return this;

}

 

MyMethodCall.prototype.setModule = function(moduleName) {

this.module = moduleName;

return this;

};

 

MyMethodCall.prototype.setAct = function(actName) {

this.act = actName;

return this;

};

 

MyMethodCall.prototype.addElement = function(tagName, value) {

if (tagName != "module" && tagName != "act") {

this.params[tagName] = value;

}

return this;

}

 

MyMethodCall.prototype.addCDATAElement = function(tagName, value) {

if (tagName != "module" && tagName != "act") {

this.CDATAparam[tagName] = value;

}

return this;

}

 

MyMethodCall.prototype.callAjax = function(callback_success, callback_error, async, method, timeout) {

// TODO: 먼저 act와 module 항목이 차있는지 확인한다.

if (async == null)

async = true;

else

async = false;

 

var opt = {};

 

// method 의 기본 값은 POST

if (!method) {

opt['method'] = 'POST';

} else {

opt['method'] = method;

}

// timeout은 기본값으로 10초

if (!timeout) {

opt['timeout'] = 10000;

} else {

opt['timeout'] = timeout;

}

 

// string을 만들어서 보낸다.

var url = 'index.php?module=' + this.module + '&act=' + this.act;

var sendString = "<?xml version='1.0' encoding='utf-8'?>";

sendString += "<methodCall>";

sendString += "<params>";

sendString += "<module>";

sendString += this.module;

sendString += "</module>";

sendString += "<act>";

sendString += this.act;

sendString += "</act>";

for (var i in this.params) {

if (i == 'indexOf') continue;

sendString += "<" + i + ">";

sendString += this.params[i];

sendString += "</" + i + ">";

url += '&' + i + "=" + this.params[i];

}

for (var i in this.CDATAparam) {

if (i == 'indexOf') continue;

sendString += "<" + i + "><![CDATA[";

sendString += this.CDATAparam[i];

sendString += "]]></" + i + ">";

}

sendString += "</params>";

sendString += "</methodCall>";

 

jQuery.ajax({

url: url,

type: opt['method'],

timeout: opt['timeout'],

dataType: 'xml',

data: sendString,

async:async,

contentType: 'text/plain',

success: callback_success,

error: callback_error

});

return this;

}

 

xe core를 1.11.2로 업그레이드 했더니 호출에 에러가 발생하네요.

에러는 parsererror로 표시가 되는데 혹시 업그레이드 관련 조언을 주실수 있으신지요?

 

글쓴이 제목 최종 글
XE 공지 글 쓰기,삭제 운영방식 변경 공지 [16] 2019.03.05 by 남기남
리천 조인 OR 서브쿼리 도움좀 부탁드려요~~  
rail_man BJ람보님 출석부 업데이트후 HTTP 500 내부 서버 오류... [1] 2019.01.21 by rail_man
별빛 최고 관리자 숨기기 할 수 있나요? [12] file 2019.01.21 by 별빛
핑크이구아나 XE 사용 중인데 어느순간부터 댓글 수정 및 삭제가 되지 않습니다. [1] 2019.01.21 by LuisK
벼리 기간별로 작성글 수 작성댓글을 구하려면 어떻게 해야할까요? [1] 2019.01.21 by LuisK
dd**** 글삭제 권한에 대하여 문의드려요. [1] 2019.01.21 by LuisK
리천 관리자 댓글 출력 수정 위치좀 알려주세요 [2] 2019.01.21 by 리천
오감 게시글 추천/비추천/신고가 안됩니다... [7] 2019.01.21 by 오감
코딩펀 게시판에서 <ul> <li> 태그가 안 먹히는 이유? [3] 2019.01.21 by 코딩펀
이건희 사이트맵 백지 현상 일어나네요 file  
디트리히A <load target="..."/> 관련 파일 경로가 어떻게 될까요?  
forgood 게시판 글에 아이디별 접근 권한 부여하기? [2] 2019.01.19 by sejin7940
allpcpc 게시판 사용자 정의를 너무 길게 넣었더니말이죠.. [1] 2019.01.19 by allpcpc
바키라 모바일에서 서 레이아웃 비정상 문의드려요  
알렉스서 메인, 즉 인텍스는 어디에 있나요? [2] 2019.01.18 by LuisK
anajo7 로그인과 관리자 페이지 오류(도와 주세요) [1] file 2019.01.18 by LuisK
xowl**** 설치된레이아웃 >기본레이아웃>메인레이아웃>설정후 이미지등록이안되요 ㅠ [1] 2019.01.17 by LuisK
풀발잡기 로그인 오류 [1] 2019.01.17 by 디자인클립
Bera 어느 순간부터 유튜브 링크를 걸었을 때 동영상이 자동으로 안뜨네요ㅠ [6] 2019.01.16 by Happiness
도토리묵 포인트 부족시 알림창 띄우기  
콜롬보 다른 회원정보 보기 권한 [4] 2019.01.16 by 콜롬보
오감 게시글에 댓글이 달릴시 이메일로 알람이 오게 하는 방법이 있을까요? [2] 2019.01.16 by 오감
댑펑 게시물 대량 이동을 DB 명령어로 가능한가요? [1] 2019.01.15 by sejin7940
별빛 특정그룹이나 회원에게 회원정보수정권한 주게 할 수 있나요? [3] 2019.01.15 by sejin7940
Happiness xe 1.11.2 로 업글후 로그인 안됩니다.  
밀가루 http 500 error 문제 [6] 2019.01.15 by 밀가루
totus**** 레이아웃 메뉴 수정하는 법? [4] file 2019.01.15 by totus****
davinchi121 xe 로컬로 설정하는 법 좀 알려주세요 [1] 2019.01.15 by LuisK
홈런볼11 게시글 내 특수문자 [1] 2019.01.15 by LuisK
대한국인 XE에서 SSL 설정하는 방법? [7] file 2019.01.13 by 세걸