制作网页的代码(制作网页的代码web)

制作网页的代码(制作网页的代码web)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 == '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"; }
编程小号
上一篇 2025-04-23 19:06
下一篇 2025-02-22 14:57

相关推荐

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
如需转载请保留出处:https://bianchenghao.cn/bian-cheng-ri-ji/68462.html