1. 26
  1. 13

    Another useful one: $0 refers to the element you’ve got selected in the inspector.

    1. 7

      Wow, I had no idea you could use $('a') or $$('a') as shorthand for document.querySelector / document.querySelectorAll. Was this added after jQuery popularized it, or has jQuery always just overloaded the $ sign operator?

      As for my contribution - copy() comes in handy in the browser console pretty often, which just copies whatever you pass in as an argument to the clipboard. And I just realized that you can use console.table in node to make simple tables that you can copy and paste into other documents.

      1. 6

        Use cd(frames[0]) to switch to the global scope of the first iframe. Regardless of the origin. Same-origin and cross-origin both work.

        1. 9

          This website is an incredible eyesore. I love it.

          1. 6

            they even provide a solution for people who don’t love it:

            document.head.parentNode.removeChild(document.head);
            
            1. 1

              Learned that trick from someone who posted it in reply to a previous article.

              1. 1

                I’ve added it to my list of bookmarklets

            2. 2

              My eyes!

              1. 2

                Thanks! Be sure to sign the guestbook.

                1. 2

                  Yeah, this is definitely what I would define as a ‘kitsch’ website design.

                2. 2

                  I also like obj.toSource() !

                  1. 1

                    Damn. I really did learn something. Most of us probably know some of them but there’s real lesser known content here, congrats.