(function(){ X.pageLogic['sqlquery'] = { init : function(){ $(document).off('click','.sqlquery-but').on('click','.sqlquery-but',function(){ var txt = $('.sql-textarea').val(); // console.log(EncodeURIFilter(txt)); X.api("ck/sql","post",{"sql": txt},function(d){ console.log(JSON.stringify(d)); $('.table-sql-box-con').html(JSON.stringify(d)); }) }) // function EncodeURIFilter(str) { // if(str != null && str != "") { // str = str.replace(/\+/g, "%2B"); // str = str.replace(/\&/g, "%26"); // } // return str; // } } }; })();