묻고답하기

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] 2019.04.10 by sejin7940
음메 페이지 비공개 [1] 2019.04.10 by SimpleCode
BarryWhite 회원 가입 시 버튼 누르면 서버오류가 뜨네요. [1] file 2019.04.09 by BarryWhite
동혀니 모바일 페이지 도움주실분 찾아요.  
『나』『na』 게시판 가로스크롤을 없애는 방법좀요.. [2] 2019.04.09 by 생크림
incation 첨부파일 순서 좀 바꾸고 싶음 file  
Hees 게시판 썸네일목록은 출력되는데 클릭하면 게시물 내용이 안나옵니다. [2] file 2019.04.08 by Hees
천하무적c8ea4 '요청한 파일을 찾을 수 없습니다.'라는 메세지 나옵니다.  
베니 네이버 애널리틱스 수집이 안되네요;; file  
PAIN php로 포인트저장 [5] 2019.04.06 by PAIN
윈터서버 https://woto.net/ 웹호스팅 업체 설치문제 [4] 2019.04.06 by 우주학개론
nong 알려주세요  
바보멍청이 데이터 이전 툴 - php.ini 환경설정에서 원격지의 파일을 열지 못하도록 되어 있습니다. [10] file 2019.04.05 by 디자인클립
chorok 무슨 기반으로 제작된 사이트일까요? [1] file 2019.04.05 by 디자인클립
rail_man 회원가입시 이메일 인증 [1] 2019.04.05 by sejin7940
댄져러스 탈퇴방법좀 해외사이트 이것좀해석해주세요 file  
결이아빠 ssl 문제가 확실한데..어떻게 해야할지..  
결이아빠 어떻게 수정하면 될까요?  
이퓨 회원가입 select 폼 형식 입력값 불러오기 질문 file  
한이흔 이미지 첨부 후 본문 삽입시 문제...몇일째 해결이 안돼여.. [1] 2019.04.02 by 결이아빠
일과여행 카톡으로 도메인을 전송하면 자동으로 나오는 이미지를 바꿀 수 없나요? [1] file 2019.04.02 by 디자인클립
모로지로 홈에 문서 이미지 넣기 문의드려요.. [2] 2019.04.02 by 모로지로
소라db952 cycle-pager 배너에 a 링크를 걸면 배너 이미지가 풀려요ㅠ [2] 2019.04.02 by 소라db952
검은고양이냐옹 레이아웃 스킨의 메뉴에 선을 하나 긋고 싶어요.. [5] file 2019.04.02 by DoorWeb
Krazee content 위젯 사진 교체 방법?? [1] file 2019.04.01 by 디자인클립
개다 익명 게시판일 때 푸시가 오면 상대방 닉네임이 노출되더라구요  
세걸 네이버 아이디 로그인 [1] 2019.04.01 by sejin7940
세걸 ssd HHD 조합으로 웹서비스 설정 [1] 2019.04.01 by 세걸
개다 홈이 로딩도 느리고 무거운 느낌인데 [1] file 2019.04.01 by 세걸
세걸 쉬운설치가 안됩니다. [3] 2019.04.01 by 세걸