묻고답하기

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 남기남
calko DB로 사이트 복귀하는 방법 [4] 2019.03.13 by calko
생컨38889 간혈적으로 OOPS 창이 나오는데 왜이럴까요?  
럭키걸 html 선택박스 없는데 file  
rail_man 가상서버 신청시 OS는 어느 것을 선택해야 하는지요  
개발자티케 주소입력 url 리다이렉션 질문드립니다!! [2] 2019.03.12 by 개발자티케
시엘 인스톨후 404 오류 문제 [1] 2019.03.12 by 시엘
우주 포인트 선물 모듈 수수료 적용 오류  
hatali 포탈사이트 서브도메인 설정  
남창훈 메인페이지 동영상 autoplay 문제 [3] 2019.03.11 by DoorWeb
한끝 'DB Table 생성과 모듈 업데이트 필요'가 안됩니다. [1] 2019.03.11 by 아찌
아찌 module - DB Table 생성하기 안되는 이유 아시는분 [2] 2019.03.11 by 아찌
kare**** 확장변수 중 전화번호를 가져올 수 있는 방법이 있을까요? [2] 2019.03.11 by kare****
누리누리 미디어 글쓰기 삽입 애드온이 관리자만 됩니다  
chorok 파이어폭스에서 아이프레임 안먹히나요??  
검은내일 서브도메인마다 시작 홈페이지를 따로 지정할 수 있나요? [2] 2019.03.08 by 검은내일
kunh**** 크롬에서 템플릿 섹션내용이 안보여요 file  
알파인웍스 섬네일 db 테이블 위치 [1] 2019.03.08 by sejin7940
homi**** xedition 슬라이드 글자색은 어떻게 바꾸나요? [5] 2019.03.07 by 마하수리
쥬크레이 익스플로러11에서만 마우스호버가 잘 동작하지 않습니다. [5] 2019.03.07 by wtst
chorok XEDITION edited by Kim Tajo 에서 좌측 상단 로고가 [1] 2019.03.07 by chorok
homi**** xe 1.11.2로 올리고 나서 본문에 파일 첨부가 안되요 [1] 2019.03.07 by homi****
-c64ac 팝업창 전체 수정 [4] file 2019.03.07 by -c64ac
하이하이데스 게시판 상단내용 입력시 역슬래쉬 생성 문제 [1] file 2019.03.07 by 마하수리
마하수리 PHP 버전 변경 후 해야 할 일 [2] 2019.03.07 by 마하수리
Masterhwan 홈페이지 스킨을 변경 했습니다 [1] 2019.03.06 by DoorWeb
KimJ 글쓰기 본문에 iframe 필터링 문제 질문 [6] file 2019.03.06 by KimJ
마하수리 카페24 PHP 버전 변경 방법 [6] 2019.03.06 by 마하수리
찌우닝 닷홈에서 웹호스팅 XE회사테마 문의합니다.. [2] 2019.03.06 by 찌우닝
디씨넷 글쓰기 화면 에러문구 어떻게 없애나요? [4] file 2019.03.05 by 디씨넷
sitara 댓글이 있는지 없는지 어떻게 아나요? [6] 2019.03.05 by sitara