工具先容

通过HTML/CSS/JS在线工具,你能夠在线输入HTML、CSS、JS 代码,该工具能实时显示運行效果

\n\n文档問題\n \n\n\t

我的第一個HTML頁面

\n\t

我的第一個段落。

\n
xxfseo.com
\n\n"; html_editor.getDoc().setValue(_html_code); }); $("#librep").click(function(){ $("#libs").modal("show"); }); $( "select" ).change(function() { $( "select option:selected" ).each(function() { _thisvar = $(this).val(); _inithtmlcode = html_editor.getValue(); if(_thisvar=='more'){ $("#libs").modal("show"); } else if(_thisvar == 'jq') { _html_script_code = " ', _libsrc + ' '); } else if(array_matches_body) { _editor_content = _editor_content.replace('', _libsrc + ''); } else { _editor_content = _libsrc + _editor_content; } html_editor.getDoc().setValue(_editor_content); } }); }); $("#save").click(function() { post_title = $("#post_title").val().trim(); var isnum = /^\d+$/.test(post_title); var isletter = /^[a-zA-Z]+$/.test(post_title); if( isnum ) { alert("请认真填写問題!"); } else if( isletter ) { alert("加点中文形貌,大師更簡略明晰!"); }else if(post_title=="" || post_title.length<6) { alert("問題不能为空且不能少于6个字符……"); } else { var htmlSource = html_editor.getValue(), cssSource = css_editor.getValue(), jsSource = js_editor.getValue(), post_content = ''; if(htmlSource!='' || jsSource!='' || cssSource!='') { $.post("/savecode.php", {post_title:post_title, html: htmlSource, js: jsSource, css:cssSource,filename: ""}, function(data){ if(data.errno) { alert(data.msg) } else { $("#save").prop('disabled',false); alert(data.msg) window.location.href=data.url } }, "json"); } else { alert("请输入你要展示的代码……"); } } }); html_editor.setSize('100%','100%'); js_editor.setSize('100%', '100%'); css_editor.setSize('100%','100%'); function submitTryit() { // 基础模板 var html = html_editor.getValue(), css = css_editor.getValue(), js = js_editor.getValue(), src = html; if (html) { var patternHtmlTag = /]*)>/im; var array_matches_html_tag = patternHtmlTag.exec(src); if (array_matches_html_tag) { src = src.replace('', ''); } var patternHead = /]*>((.|[\n\r])*)<\/head>/im var array_matches_head = patternHead.exec(src); var patternBodyTag = /]*)>/im; var array_matches_body_tag = patternBodyTag.exec(src); if (array_matches_body_tag) { src = src.replace('', ''); } } //console.log(css); if (css.indexOf(''; if (array_matches_head) { src = src.replace(' ', css + ' '); } else if (array_matches_body_tag) { src = src.replace('', css + ''); } else { src += css; } } // Javascript if(js) { js = '