Tag: javascript


what does "this" refer to in javascript?

Introductionthis in javascript is always a mysterious thing. Some programmers who have written a lot of javascript code still cannot tell the value of this every now and then. So today, I decided to w


Inheritance in Javascript

Javascript uses prototype chains to make inheritance work, that’s a little odd given that other OOP languages usually use class and extend. So to fully understand inheritance in javascript, we first h


get selected text in chrome

EDITThe method mentioned here is overcomplicated. To see a simple method, please refer to my answer at stackoverflow.com prefaceI want to get the selected text in chrome. After hours of searching and