Js
cyBlogs
cy的个人博客
展开
-
JavaScript中的匿名函数
参考文章:https://www.cnblogs.com/hammerc/p/7390424.html 这是因为this是那个调用他的对象,而setTimeout之后调用它的那个对象变成window了 function Test() { this.num = 100; this.func = function(){ console.log(this.num); /...原创 2018-12-07 13:44:07 · 244 阅读 · 0 评论 -
浏览器或web view向html页面传值
function getUrlParam(name) { var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象 var r = window.location.search.substr(1).match(reg); //匹配目标参数 if (...原创 2019-01-27 12:51:45 · 604 阅读 · 0 评论 -
js禁止缓存
//禁止缓存 if(!window.name){ var str = Math.random().toString(36).substr(2); window.location.href += '?S='+ str; window.name = 'isreload'; }原创 2019-01-27 13:50:08 · 822 阅读 · 0 评论