• 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

  • Handy MySQL Commands

    Log into mysql: (enter password on next prompt) Show all databases on server: To reset an auto_increment field to 1: To load a local csv file into an empty existing table: (This assumes you’ve already created your empty table with the same number of fields that your csv file has.) To backup/dump a mysql db 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

  • 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