Google

Friday, March 18, 2005

A Neat Trick

Here's an embedded snippet of my shameless self-promotion:

<a href = 
"
 javascript: -1 != navigator.appName.indexOf('Microsoft')
  ? window.external.AddFavorite('<$BlogURL$>', '<$BlogTitle$>')
  : void window.open('Enable Live Bookmarks')
" 
title = "Bookmark">书签</a>
This elegant (pourquoi pas?) JavaScript one-liner first identifies a browser. For the Microsoft crowd, a mouse click will painlessly add my blog to Favorites; for others, Firefox is recommended because of its wonderful "Live Bookmarks" feature (if a user hasn't noticed that my blog is conspicuously RSS-friendly). Well-done, if I may say so myself. An apparent bug is that a Firefox surfer can open the intended Mozilla URL only in a new window. Much more to learn about tabbed browsing…

0 Comments:

Post a Comment

<< Home