";
html_editor.getDoc().setValue(_html_script_code + _inithtmlcode);
}else if(_thisvar == 'bs3') {
_html_script_code = "
";
html_editor.getDoc().setValue(_html_script_code + _inithtmlcode);
}else if(_thisvar == 'bs4') {
_html_script_code = "
";
html_editor.getDoc().setValue(_html_script_code + _inithtmlcode);
}else if(_thisvar == 'ag') {
_html_script_code = "
";
html_editor.getDoc().setValue(_html_script_code + _inithtmlcode);
}else if(_thisvar == 'vue2') {
_html_script_code = "
";
html_editor.getDoc().setValue(_html_script_code + _inithtmlcode);
}else if(_thisvar == 'vue3') {
_html_script_code = "
";
html_editor.getDoc().setValue(_html_script_code + _inithtmlcode);
}else if(_thisvar == 'fa') {
_html_script_code = "
";
html_editor.getDoc().setValue(_html_script_code + _inithtmlcode);
}
});
});
$('#libs').on('hidden.bs.modal', function () {
$("#sel1 option:first-child").attr('selected', true);
$("#sel1 option:last-child").attr('selected', false);
$("#libs-table tr").removeClass("success");
})
$("#filter").keyup(function() {
_search_value = $(this).val();
//https://api.staticfile.net/libraries
//https://api.cdnjs.com/libraries
$.get('https://api.staticfile.net/libraries',{search:_search_value,fields:"homepage"},function(data) {
var _val_tr ='';
$("#fa-spinner").show();
$.each(data.results, function(i, item) {
if(i
< 10) { _val_tr += ''+item.name+' '+item.latest+' '; } else { return false; }; }); if(_val_tr) { $("#libs-table").html('库名 地址插入' + _val_tr); } $("#fa-spinner").hide(); }); }); $( document ).ajaxComplete(function() { $("tr").not(':first').hover( function () { if(!$(this).hasClass("success")) { $(this).addClass("warning"); } }, function () { $(this).removeClass("warning"); } ); $("tr").not(':first').click(function() { if(!$(this).hasClass("success")) { _editor_content = html_editor.getValue(); $(this).addClass("success") $(this).removeClass("warning"); _libsrc = $(this).find("td").eq(1).text(); if(_editor_content.indexOf(_libsrc) !== -1 ) { return; } if( _libsrc.indexOf('.js')!==-1 ){ _libsrc = ' '; } else if(_libsrc.indexOf('.css')!==-1) { _libsrc = ' '; } patternBody = / ]*>((.|[ ])*)/im; array_matches_body = patternBody.exec(_editor_content); patternHead = / ]*>((.|[ ])*)/im; array_matches_head = patternHead.exec(_editor_content); if(array_matches_head) { _editor_content = _editor_content.replace('', _libsrc + '
/head>'); } else if(array_matches_body) { _editor_content = _editor_content.replace('
html>', '
'); } var patternHead = / ]*>((.|[ ])*)/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 = '
';
if (array_matches_body_tag) {
src = src.replace('
/body>', js + '
'); }else { src += js; } } text = src; var ifr = document.createElement("iframe"); ifr.setAttribute("frameborder", "0"); ifr.setAttribute("id", "iframeResult"); document.getElementById("output").innerHTML = ""; document.getElementById("output").appendChild(ifr); var ifrw = (ifr.contentWindow) ? ifr.contentWindow: (ifr.contentDocument.document) ? ifr.contentDocument.document: ifr.contentDocument; ifrw.document.open(); ifrw.document.write(text); ifrw.document.close(); autodivheight(); } submitTryit(); window.addEventListener("resize", autodivheight); function autodivheight(){ var winHeight=0; if (window.innerHeight) { winHeight = window.innerHeight; } else if ((document.body) && (document.body.clientHeight)) { winHeight = document.body.clientHeight; } //通过深入Document内部对body进行 检测,获取 浏览器窗口高度 if (document.documentElement && document.documentElement.clientHeight) { winHeight = document.documentElement.clientHeight; } height = height = (winHeight - 60) * 0.86; document.getElementById("splitContainer").style.height= height +"px"; } 到此这篇制作网页的代码(制作网页的代码web)的文章就介绍到这了,更多相关内容请继续浏览下面的相关 推荐文章,希望大家都能在编程的领域有一番成就!版权声明:
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如若内容造成侵权、违法违规、事实不符,请将相关资料发送至xkadmin@xkablog.com进行投诉反馈,一经查实,立即处理!
转载请注明出处,原文链接:https://www.xkablog.com/bcyy/22140.html