随笔分类 -  JavaScript基础教程

JavaScript基础教程
Callback Hell
摘要:A guide to writing asynchronous JavaScript programs What is "callback hell"? Asynchronous JavaScript, or JavaScript that uses callbacks, is hard to ge 阅读全文

posted @ 2021-10-21 20:31 漫思 阅读(46) 评论(0) 推荐(0) 编辑

window.location 属性详解
摘要:http://47.117.141.27:3131/Admin/Login?aspxerrorpath=/ 阅读全文

posted @ 2021-08-16 20:44 漫思 阅读(76) 评论(0) 推荐(0) 编辑

url转义。绝对正确的url转义的东西
摘要:在阿里上班积累的字符串转义 JS的写法 encodeURIComponent(window.location.href); decodeURIComponent(window.location.href); 如果是C#的写法呢 c#实现Javascript的encodeURIComponent()函 阅读全文

posted @ 2021-08-14 18:13 漫思 阅读(168) 评论(0) 推荐(0) 编辑

js获取浏览器版本
摘要:function getOSAndBrowser(){ var os = navigator.platform; var userAgent = navigator.userAgent; console.log(userAgent); var info = ""; var tempArray = " 阅读全文

posted @ 2021-04-09 10:39 漫思 阅读(211) 评论(0) 推荐(0) 编辑

别再为了this发愁了------JS中的this机制
摘要:别再为了this发愁了 JS中的this机制 题记:JavaScript中有很多令人困惑的地方,或者叫做机制。但是,就是这些东西让JavaScript显得那么美好而与众不同。比方说函数也是对象、闭包、原型链继承等等,而这其中就包括颇让人费解的this机制。不管是新手还是老手,不仔细深抠一下还真闹不明 阅读全文

posted @ 2020-08-07 09:28 漫思 阅读(209) 评论(0) 推荐(0) 编辑

promise.all 异常处理
摘要:promise.all 中任何一个promise 出现错误的时候都会执行reject,导致其它正常返回的数据也无法使用了有两个解决方法:1.全部改为串行调用(失去了node 并发优势)2.当promise捕获到error 的时候,代码吃掉这个异常,返回resolve,约定特殊格式表示这个调用成功了 阅读全文

posted @ 2020-03-05 23:10 漫思 阅读(3058) 评论(0) 推荐(0) 编辑

js下载文件防止白屏
摘要:欢迎捐赠 思路:用js创建一个iframe,让后指定src为下载目录。var ifup = document.getElementById("ifup");if(ifup){ document.body.removeChild(ifup);}var elemIF = document.createE 阅读全文

posted @ 2020-02-18 16:03 漫思 阅读(527) 评论(0) 推荐(0) 编辑

原生js获取元素的宽高
摘要:<div id="box"></div> #box{ background-color: lightgrey; width: 300px; border: 25px solid green; padding: 25px; margin: 25px; height:60px; } //获取盒子的内容高 阅读全文

posted @ 2020-02-16 13:00 漫思 阅读(2522) 评论(0) 推荐(0) 编辑

回车登录页面的问题
摘要:$('#txtUserName,#txtpwd').val(''); $('#txtUserName').focus(); $("#txtUserName").bind('keypress', function (event) { if (event.keyCode == "13") { if( $ 阅读全文

posted @ 2019-02-19 14:47 漫思 阅读(154) 评论(0) 推荐(0) 编辑

导航

< 2025年2月 >
26 27 28 29 30 31 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 1
2 3 4 5 6 7 8
点击右上角即可分享
微信分享提示