首页控制台console提示大量信息,能消除吗?
本帖最后由 linxl 于 2020-7-7 14:47 编辑这主要是boot.js内使用代码的提醒,可以不使用boot.js来辅助加载miniui的
直接引用的,按次序引用
jquery.js
miniui.js
miniui.css
icon.css
就可以了。 本帖最后由 linxl 于 2020-7-6 17:05 编辑
felt 发表于 2020-7-6 09:00 static/image/common/back.gif
这主要是boot.js内使用代码的提醒,可以不使用boot.js来辅助加载miniui的
直接引用的,按次序引用
jquery.j ...
如果继续用boot.js加载miniui环境,不会有不良影响吧?网上对使用docment.write()颇有微词,曾尝试用其他方法加载js,虽然在控制台看已经加载到head标签下,但是没有执行,不认jquery和miniui。
例如
var dynamicLoading = {
css: function(path){
if(!path || path.length === 0){
throw new Error('argument "path" is required !');
}
var head = document.getElementsByTagName('head');
var link = document.createElement('link');
link.href = path;
link.async = false;
link.rel = 'stylesheet';
link.type = 'text/css';
head.appendChild(link);
},
js: function(path){
if(!path || path.length === 0){
throw new Error('argument "path" is required !');
}
var head = document.getElementsByTagName('head');
var script = document.createElement('script');
script.src = path;
script.async = false;
script.type = 'text/javascript';
head.appendChild(script);
}
};
dynamicLoading.js(bootPATH+ "jquery.min.js");
dynamicLoading.js(bootPATH+ "miniui/miniui.js");
程序看似完美,后台看也加载上了,但不起作用 linxl 发表于 2020-7-6 15:05 static/image/common/back.gif
如果继续用boot.js加载miniui环境,不会有不良影响吧?网上对使用docment.write()颇有微词,曾尝试用其他 ...
本地测试可以的,把这代码放到boot.js内使用 本帖最后由 linxl 于 2020-7-6 17:01 编辑
felt 发表于 2020-7-6 15:53 static/image/common/back.gif
本地测试可以的,把这代码放到boot.js内使用
360浏览器兼容模式下可以,极速模式下不行!也就是说IE还行,Chrome不行。 linxl 发表于 2020-7-6 16:58 static/image/common/back.gif
360浏览器兼容模式下可以,极速模式下不行!也就是说IE还行,Chrome不行。
linxl 发表于 2020-7-6 17:27 static/image/common/back.gif
把页面js都包裹在window.onload=function(){}内,确保完全加载完毕后再使用 felt 发表于 2020-7-6 17:49 static/image/common/back.gif
把页面js都包裹在window.onload=function(){}内,确保完全加载完毕后再使用
把demo的index.html中js全包起来好像也不行(极速模式)
<script type="text/javascript">
window.onunload = function () {
mini.parse();
function onBeforeExpand(e) {
var tree = e.sender;
var nowNode = e.node;
var level = tree.getLevel(nowNode);
var root = tree.getRootNode();
tree.cascadeChild(root, function (node) {
if (tree.isExpandedNode(node)) {
var level2 = tree.getLevel(node);
if (node != nowNode && !tree.isAncestor(node, nowNode) && level == level2) {
tree.collapseNode(node, true);
}
}
});
}
}
</script>
linxl 发表于 2020-7-6 19:00 static/image/common/back.gif
把demo的index.html中js全包起来好像也不行(极速模式)
window.onunload = function () {
那就只能一个个引入js和css文件了。
按顺序引用
jquery.js
miniui.js
miniui.css
icon.css
页:
[1]