javascript
zhangjie617
这个作者很懒,什么都没留下…
展开
-
检测本页面是否为本地文件方式打开
<script> if (window.location.protocol === "file:") { if ( confirm( "本页面无法使用本地文件方式打开,是否跳转到本项目在线地址?" ) ) { window.location = "https://www.myProject.com"; } ...原创 2021-05-12 12:52:13 · 181 阅读 · 0 评论 -
javascript中简单的通用树结构遍历方法
示例: let tree = { name: "root", childrens: [{ name: "child1" }, { name: "child2", childrens: [{ name: "child2-1" },{ name: "child2-2" } ] },{ name: "child3" }] } treeForEach(tree,function(node,parent){ if(!parent){ parent.原创 2021-05-11 14:04:48 · 206 阅读 · 0 评论