var editorFooter = ace.edit("editor-footer"); // теперь обращаться к редактору будем через editor // Далее весь экшон будет проходить тут! editorFooter.setTheme("ace/theme/twilight"); editorFooter.getSession().setMode("ace/mode/html"); editorFooter.setValue($("#ta-footer").val()); var editorHeader = ace.edit("editor-header"); // теперь обращаться к редактору будем через editor // Далее весь экшон будет проходить тут! editorHeader.setTheme("ace/theme/twilight"); editorHeader.getSession().setMode("ace/mode/html"); var editorJs = ace.edit("editor-js"); // теперь обращаться к редактору будем через editor // Далее весь экшон будет проходить тут! editorJs.setTheme("ace/theme/twilight"); editorJs.getSession().setMode("ace/mode/javascript"); var editorCss = ace.edit("editor-css"); // теперь обращаться к редактору будем через editor // Далее весь экшон будет проходить тут! editorCss.setTheme("ace/theme/twilight"); editorCss.getSession().setMode("ace/mode/css"); editorFooter.setValue($("#ta-footer").val()); editorHeader.setValue($("#ta-header").val()); editorJs.setValue($("#ta-js").val()); editorCss.setValue($("#ta-css").val()); $("#ok").click(function (e) { e.preventDefault(); var txt = editorFooter.getValue(); //alert(code); $.ajax({ type: "POST", url: '/act/skin', data: "act=updatefooter&txt=" + encodeURIComponent(txt) }); var txt = editorHeader.getValue(); $.ajax({ type: "POST", url: '/act/skin', data: "act=updateheader&txt=" + encodeURIComponent(txt) }); var txt = editorJs.getValue(); $.ajax({ type: "POST", url: '/act/skin', data: "act=updatejs&txt=" + encodeURIComponent(txt) }); var txt = editorCss.getValue(); $.ajax({ type: "POST", url: '/act/skin', data: "act=updatecss&txt=" + encodeURIComponent(txt) }); });