mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-01 16:22:41 +09:00
tree javascript change : 메뉴, 게시판분류, 홈페이지
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@5055 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
987c7fbfbd
commit
19859b1615
65 changed files with 1591 additions and 875 deletions
|
|
@ -386,3 +386,59 @@ function xml2json(xml, tab, ignoreAttrib) {
|
|||
var json = X.toJson(X.toObj(X.removeWhite(xml)), xml.nodeName, "");
|
||||
return "{" + (tab ? json.replace(/\t/g, tab) : json.replace(/\t|\n/g, "")) + "}";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief exec_json (exec_xml와 같은 용도)
|
||||
**/
|
||||
(function($){
|
||||
$.exec_json = function(action,data,func){
|
||||
if(typeof(data) == 'undefined') data = {};
|
||||
action = action.split(".");
|
||||
if(action.length == 2){
|
||||
|
||||
if(show_waiting_message) {
|
||||
$("#waitingforserverresponse").html(waiting_message).css('top',$(document).scrollTop()+20).css('left',$(document).scrollLeft()+20).css('visibility','visible');
|
||||
}
|
||||
|
||||
$.extend(data,{module:action[0],act:action[1]});
|
||||
$.ajax({
|
||||
type:"POST"
|
||||
,dataType:"json"
|
||||
,url:request_uri
|
||||
,contentType:"application/json"
|
||||
,data:$.param(data)
|
||||
,success : function(data){
|
||||
$("#waitingforserverresponse").css('visibility','hidden');
|
||||
if(data.error > 0) alert(data.message);
|
||||
if($.isFunction(func)) func(data);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
$.fn.exec_html = function(action,data,type){
|
||||
if(typeof(data) == 'undefined') data = {};
|
||||
if(!$.inArray(type, ['html','append','prepend'])) type = 'html';
|
||||
|
||||
var self = $(this);
|
||||
action = action.split(".");
|
||||
if(action.length == 2){
|
||||
if(show_waiting_message) {
|
||||
$("#waitingforserverresponse").html(waiting_message).css('top',$(document).scrollTop()+20).css('left',$(document).scrollLeft()+20).css('visibility','visible');
|
||||
}
|
||||
|
||||
$.extend(data,{module:action[0],act:action[1]});
|
||||
$.ajax({
|
||||
type:"POST"
|
||||
,dataType:"html"
|
||||
,url:request_uri
|
||||
,data:$.param(data)
|
||||
,success : function(html){
|
||||
$("#waitingforserverresponse").css('visibility','hidden');
|
||||
self[type](html);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
})(jQuery);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue