묻고답하기

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 남기남
rail_man 회원목록에서 관리자를 삭제하였습니다. [2] 2019.02.17 by rail_man
roks821 파일첨부동작?  
모던웹 첨부파일 자동본문삽입 안되게 할수는 없나요? [2] 2019.02.16 by orangehome
railman 이메일 인증시 오류가 발생하였습니다. file  
지나 게시판에 글 쓰고 등록 클릭하면 그대로 있네요... [2] 2019.02.15 by 지나
soyum**** php)다운로드 파일이 제대로 안보이는 오류 [2] file 2019.02.15 by soyum****
CtrlV 외부페이지 DB 불러오기가 왜 안될까요? [2] 2019.02.15 by CtrlV
inhyeparklee 설정>게시판정보>고급>'섬네일' 추가해도 저장하면 목록에서 사라짐 +썸네일 가려짐 file  
함형규 안녕하세요.. 도움 주실분..구합니다.. [1] 2019.02.14 by LuisK
T1000 메인 페이지에서 사진을 꽉 채우려고 하려면 [2] 2019.02.12 by T1000
꿀잠자요 잘못된 응답을 전송했습니다. 라고 뜹니다. [1] 2019.02.12 by LuisK
꿀잠자요 XE 사용 초보입니다. 로그인 오류로 아얘 접속이 안됩니다. [4] 2019.02.12 by 꿀잠자요
railman 홈페이지에서 상담신청 게시판을 만들고자 합니다. [1] 2019.02.12 by LuisK
김세환 XEDITION 레이아웃 모바일 로그인창 질문드립니다 [1] file 2019.02.11 by DoorWeb
야호딩동댕 스켓치북 모듈스킨 본문 버튼 수정 부탁드립니다. [2] file 2019.02.11 by 야호딩동댕
shoothing**** 스케치북5 게시판 체크박스 질문 좀 드릴께요 [4] 2019.02.10 by shoothing****
inhyeparklee 원본글 복사를 했는데, 댓글은 없네요. 댓글은 복사가 안되나요? [2] 2019.02.09 by inhyeparklee
삼무 홈페이지에 회원 가입하려는데 웹 페이지 미시지가 자꾸 떠는 것은 어떻게 헤야 하나요 [2] file 2019.02.09 by 삼무
크림스푸 코어 업로드 후 글자깨짐 [4] file 2019.02.09 by inhyeparklee
inhyeparklee 특정한 게시물만 깨지는 현상(+게시판 전체 글 깨짐) file  
정주신 웹페이지를 긁어온후 그값을 위젯으로 올릴수 없나요? [1] 2019.02.09 by 정주신
㉿반딧불 [zeroboard4] 한번 봐 주십시요. [1] 2019.02.08 by DoorWeb
날제비 홈페이지 추가 수정관련 문의 드립니다. [2] file 2019.02.08 by DoorWeb
shoothing**** 스케치북5 관리자 로그인시 체크박스가 안보여요 [3] file 2019.02.08 by sejin7940
david 웹사이트에 올려진 사진들이 나타나지 않습니다. [2] file 2019.02.08 by david
와우 이런식으로 옷 코디하는거 ㅜㅜ 어떻게 구축하는건지 아시는분 계신가요?  
arian 게시판에 html 입력시 사라지는 현상 [2] 2019.02.08 by arian
수현수진아빠 한사이트에서 다른 레이아웃을 적용할려면... [1] 2019.02.08 by sejin7940
키미즈 CORE 업그레이드와관련하여 궁금한게 있습니다 [4] 2019.02.07 by sejin7940
세걸 접속통계치 오차 [1] file 2019.02.07 by sejin7940