• HTML Character Entities in Javascript

    Sometimes you need to write html character entities in javascript, but html character entities can’t be used, because they don’t get interpreted by javascript. In javascript, you need to use the equivalent unicode character codes instead. HTML character entity, wrong: formElement.value = “Dirección”; You get: Dirección Unicode character code, correct: formElement.value = “Direcci\u00F3n”; You get: more

  • When Making a Directive for AngularJS

    Worth Reading:  https://docs.angularjs.org/guide/directive Especially this at the very bottom of that page: By ‘expose an API’, they mean ‘add some this.doSomething() {…} functions to the controller that are reachable from outside the controller’.  Like public class methods.  If you’re not needing any of those, don’t add a controller to the directive.

  • block ads with hosts files

    Anyone with 15 minutes of free time can edit their hosts file to block 99% of the ads that appear on web pages, for free. This works on PCs, Macs, and Linux/Unix computers. What’s a “hosts” file?  It’s a file named “hosts”, and every normal computer sold to consumers has one. A background on hosts more

  • jQuery parsererror: clean up your JSON objects

    Has your JSON using jQuery web app suddenly stopped working?  Getting a parsererror on your JSON objects, where you got none before?  This is what happened to me when my site upgraded to jQuery 1.4. I use the Google API’s jQuery, and it automatically upgraded my whole site to jQuery 1.4.   In jQuery 1.4, more

  • How to type accents é, è, ñ, ü, ê and other special characters on your Mac keyboard

    Problem:  You’re on an English keyboard on a Mac, and you need to type letters with accents, like é, è, ñ, ü, ê or other special characters, like ç, å, æ, or œ. Solution:   Hold down the vowel key for a little bit longer than usual, and a hint with accented versions of your vowel more