前端
前端-注意
前端注意事项:
响应式布局
@media属性
this到底谁?
name = 'alex' function func(){ console.log(this.name); # window.name } func()
var name = 'alex'; function func() { var name = 'mjj'; function inner() { console.log(this.name); // window “alex” } inner() }
var name = 'alex';function func() { var name </span>= <span style="color: #800000;">'</span><span style="color: #800000;">mjj</span><span style="color: #800000;">'</span><span style="color: #000000;">; (function(){ console.log(this.name); </span>//<span style="color: #000000;"> window “alex” 自执行函数 })(); } func();</span></pre>
var name = 'alex'; var v = { name:'mjj', func:function () { console.log(this.name); # “mjj” } }; v.func()
var name = 'alex'; var v = { name:'mjj', func:function () { console.log(this.name); // mjj(function () { console.log(this.name); </span>//<span style="color: #000000;"> alex </span>window.name 自执行函数指的是window</pre>
})() } }; v.func()
var name = 'alex'; var v = { name:'mjj', func:function () { console.log(this.name); // mjj var that = this; (function () { console.log(that.name); // mjj })() } }; v.func()
</div>
<div class="postDesc">posted @ <span id="post-date">2018-11-24 21:16</span> <a href="https://www.cnblogs.com/hnlmy/">hnlmy</a> 阅读(<span id="post_view_count">1</span>) 评论(<span id="post_comment_count">0</span>) <a href="https://i.cnblogs.com/EditPosts.aspx?postid=10013595" rel="nofollow">编辑</a> <a href="#" onclick="AddToWz(10013595);return false;">收藏</a></div>
</div>