묻고답하기

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 남기남
달려라흰둥아 게시판에 글쓰면 작은 프레임이 생겨요.. [1] file 2019.04.25 by LuisK
별빛 코어 업데이트 하면, 수정한 코드를 다시 수정해야 하나요? [4] 2019.04.25 by 별빛
이효선 로그인이 계속 안되니.. 답답해 죽겠어요.. [1] 2019.04.25 by sejin7940
rrryyy3 스샷 첨부했습니다. 모바일뷰 초기화면이 계속 나옵니다 ㅠㅠ file  
손주사랑 글씨가깨져서요 알려주시면 고맙겠습니다 [4] file 2019.04.24 by 손주사랑
eptmtk**** 스케치북 게시판에서 유튜브 링크를 쓰면 홈페이지가 깨집니다... [1] file 2019.04.24 by DoorWeb
햇빛소년 게시글 작성시 동영상, 이미지 링크를 모방일 PC 분리해서 연결하는 법. [2] 2019.04.23 by 햇빛소년
paraduxx 특정 게시물을 특정 회원만 확인 하게 하는 방법이 있을까요 ? [1] 2019.04.23 by paraduxx
별빛 파일업로드 크기 25MB 이상 올리는 방법을 알고 싶습니다. [4] 2019.04.23 by 별빛
kminict 다국어로 설정된 리스트 삭제 방법 [2] file 2019.04.23 by kminict
익명89 1.11.5 업데이트 문제...? [3] file 2019.04.22 by 익명89
차이나로 메인 메뉴 클릭시 메인화면으로만 이동합니다. [5] 2019.04.21 by 디자인클립
WhiteRose SOS.. Fatal error object/Object.class.php 관련 [2] 2019.04.20 by WhiteRose
kminict 게시판 파일 업로드 실패 [3] 2019.04.19 by Happiness
아이고아낙네요 사이트 메뉴 사라짐 ㅠ,ㅠ [1] file 2019.04.19 by AimJin
KanTa 누리고 EPAY 모듈정보 설정 질문 드립니다. [1] file 2019.04.19 by 이온디
서리 글보기, 답글에서 게시물 변수를 각기 다르게 불러오는 오류?  
kminict 게시판 첨부파일 업로드 경로 질문 [4] 2019.04.18 by kminict
서리 때려 죽여도 특정 모듈에서 모바일 레이아웃이 적용이 안됩니다. OTL  
PAIN 포인트랭킹 위젯  
예진JEvans 제발 부탁드립니다. contact us 이메일 주소값 오류가 왜 나는지 모르겠습니다 [3] 2019.04.16 by framei
에스엠과호돌 Fatal error: Call to a member function getNextPage() on a non-object in 에러... [1] 2019.04.16 by SimpleCode
동혀니 AJAX 에러 file  
rail_man 게시판에서 "이게사물을" 삭제하고자 합니다. [2] file 2019.04.15 by rail_man
홈런볼11 특정 회원에게 회원 관리 위임 [1] 2019.04.15 by SimpleCode
초보개 sql 쿼리 질문  
흑묘백묘 이미지프로세스 자료실 페이지 캡쳐해서 좀 올려주세요^^ [2] file 2019.04.12 by 흑묘백묘
두발잔차 관리자에서 코어 업데이트 및 각 설정이 저장 안됩니다. [2] 2019.04.12 by 두발잔차
rail_man files 권한이 755로 되어 있습니다. [1] 2019.04.12 by SimpleCode
kminict 호스팅 없이 개인서버로 설치가 가능한가요? [2] 2019.04.12 by kminict