Today I was revising some older javascripts to match my XHTML 1.1 code. In case you're not yet aware, JavaScript's document.write
method is not allowed in well-formed XHTML pages - as described at W3C in XHTML FAQ:
Because of the way XML is defined, it is not possible to do tricks like this, where markup is generated by scripting while the parser is still parsing the markup.
However, document.write
is used everywhere so if you still rely on some older non-XHTML-aware scripts I'll show you how to give your legacy code a DOM-facelift.
Today I embedded two Javascripts into my template and by pure coincidence both are Google-related.
Highlight incoming search queries
First is searchhi by The Daily Kryogenix. It's easy to install (just don't forget to modify your CSS) and works reliably.
N.B. Note however that apart from Google searches this script also recognizes Yahoo, AllTheWeb and any other search engine using appropriate query format.
February 4
Filed under: Applications, Coding, Unix
Setting up Ruby and Rails
Installing required packages
First you'll have to get the required ruby
packages:
apt-get install libruby libruby1.8 ruby ruby1.8 libzlib-ruby1.8 libyaml-ruby1.8 rdoc1.8 libiconv-ruby1.8 irb1.8 libreadline-ruby1.8 libcurses-ruby1.8 libbigdecimal-ruby1.8 libdrb-ruby1.8 liberb-ruby1.8
January 25
Filed under: Coding, Web Services
I wrote a very simple piece of javascript for adding current selection to your list of goals on 43things.
You use it like this:
- drag this link to your bookmark bar (IE/Mozilla/Firefox/Safari etc): I want to...
- select some text on any webpage with your mouse
- click the link that you just dragged - and enjoy instant result!
NB: Make sure you're logged in to 43things before you attempt adding new goals.