묻고답하기

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 남기남
psb**** contact us 폼에서 e-mail 없앴는데 에러가 뜨네요. [2] 2019.07.10 by 우주학개론
바키라 로고를 누르면 홈화면으로 안가네요 [2] file 2019.07.10 by 우주학개론
jhc****06a74 .htaccess json 파일 엑세스 문제  
또치 mod_jk 문의.. ㅠ  
최곰 데이터 이전 관련 문의드립니다. [2] 2019.07.08 by sejin7940
손주사랑 달력과 방문기록 위젯 크기조정 어디서 고치나요... [4] file 2019.07.08 by 손주사랑
Maria XE 기반 홈페이지 제작시에... [4] 2019.07.08 by Maria
손주사랑 달력하나 추천해 주세요^*^ file  
봄비 첨부파일 기능을 막으려면요? [2] 2019.07.05 by 봄비
psb**** contact us 에서 필수항목 사용 안하게 하는방법은요? [4] 2019.07.05 by 디스케이션
miasanmia 업데이트를 눌렀더니 사이트 접속이 안됩니다ㅠㅠ [2] 2019.07.05 by 디스케이션
나답게 네이버 밴드 공유시 글쓰기 말고 일정쓰기 api는 없는걸까요? [1] 2019.07.04 by SimpleCode
Dstone Err : '' template file does not exists. [4] 2019.07.04 by SimpleCode
제인쏭킴 새 릴리즈 추가 시 zip 압출 오류로 인한 파일 미등록 [1] file 2019.07.04 by SimpleCode
케레인 위젯페이지도 다국어 지원하나요? [7] 2019.07.03 by 대한국인
SSUN 게시판 글쓰기 [1] 2019.07.03 by XE카오스
Julian centos7 + Nginx XE 403에러 [3] 2019.07.02 by Julian
이정 xe를 편하게 이용할려면 어떤걸 공부해야할까요 [2] 2019.07.02 by 제이와이엔소프트
추억 확장변수에서 숫자만 나오게 하고 싶습니다. [5] file 2019.07.01 by JustDoItAnything
tae00 회원가입시 저장안됨, 로그인 오류 file  
불꽃남자cc4e1 DB접속오류 (로그인유지?) [3] 2019.07.01 by 기진곰
바키라 브라우저 제목이 안바껴요..ㅜㅜ [2] file 2019.07.01 by 바키라
원더랜드 구글 서치콘솔 등록 [2] 2019.07.01 by 원더랜드
쉐랄랑 제작의뢰 글 올렸다 먹튀 당했는데 어디에 신고해야할까요? [3] 2019.06.30 by PAIN
프리뷰 스포츠 티비중계 설치제공해주는업체 추천좀 부탁드림니다  
바키라 브라우저 제목이 안바뀝니다. [1] 2019.07.01 by 바키라
t**** ios 환경 (아이폰, 아이패드)에서 입력폼 작동 안되는 현상? [1] 2019.06.29 by t****
동혀니 달력/PlannerXE123 설정 관련[사례드림]  
동혀니 소셜 로그인 관련.. file  
동혀니 xe 코어 다운로드가 안됩니다. [2] 2019.06.28 by sejin7940