Prevent a cross-origin iframe from scrolling its parent
Accidentally found in business work that after embedding some specific iframes, the top-level page will automatically scroll to the iframe, at the the time when iframe is loaded.
Articles filed under JavaScript.
6 articles
Accidentally found in business work that after embedding some specific iframes, the top-level page will automatically scroll to the iframe, at the the time when iframe is loaded.
在 JavaScript 中,this 的绑定是动态的,在函数被调用的时候绑定,它指向什么完全取决于函数在哪里调用,绑定规则有默认绑定、隐式绑定、显式绑定、 new 绑定等,本文就硬绑定与软绑定的原理进行深入介绍。
重载,就是函数或者方法有相同的名称,但是参数列表不相同的情形。一直觉得 JavaScript 是没有重载的,直到 TypeScript 的出现,所以我一直觉得 JavaScript 没有重载,TypeScript 才有,但是现在看来我是错的。
Code readability is fundamental for development — it is key to maintainability and working together with a team. This article will detail the best practices when writing readable code in JavaScript.
正则表达式的基本组成元素可以分为:字符和元字符。字符很好理解,通常正则表达式里面使用的就是数字、英文字母。而元字符,也被称为特殊字符,是一些用来表示特殊语义的字符。如 ^ 表示非, | 表示或等。利用这些元字符,才能构造出强大的表达式模式 (pattern)。
第一次听到这个说法是在 Angular 的时候,我们都知道 Angular 内部大量使用了依赖注入。虽然我到现在也没玩过 😂,不过这并不影响我们来探究一下它。