Bookmarklet geeks, I need your help!

Just on a lark, I’m trying to write a bookmarklet which will allow a person to enter a Dave’s Garden member name, say Gardenwife for instance, and be taken to that member’s page at Dave’s Garden.


I’m assuming it should be something like the Merriam-Webster Dictionary bookmarklet which lets a person enter a word, then be taken to the page at the site containing that word.

This is the M-W bookmarklet’s javascript:

javascript:Qr=document.selection.createRange().text;if(!Qr){void(Qr=prompt(‘Enter word to find in Merriam-Webster Dictionary:’,”))}if(Qr)location.href=’http://www.m-w.com/cgi-bin/dictionary?’+escape(Qr)+’ ‘

This is what I fiddled around with, but it doesn’t quite work:

javascript:Qr=document.selection.createRange().text;if(!Qr){void(Qr=prompt(‘Enter DG Member whose page you wish to go to:’,”))}if(Qr)location.href=’http://davesgarden.com/members/(Qr)+’ ‘

When I enter the whole thing in the URL field of a new favorite’s properties, nothing happens. If I enter everythng except that last part (the +’ ‘) I DO get the pop-up and can enter text. But, alas, I get this. It’s so close! I must be on the right track…

This is kinda fun, but I’m stumped. Any ideas?

UPDATE at 2:40am

Wooo-hoooo! I’d left out one wee bit which made all the difference! Here’s the revised script, and it works!

javascript:Qr=document.selection.createRange().text;if(!Qr){void(Qr=prompt(‘Enter DG Member whose page you wish to go to:’,”))}if(Qr)location.href=’http://davesgarden.com/members/’+escape(Qr)+’ ‘

OKAY…Now I just need to see how to make it so people can just drag it onto their links bar or make a favorite out of it. Hmmmmm….

ANOTHER UPDATE at 2:53am

Okay, I’m on a roll. Let’s see if THIS works…

Drag this DG link to your toolbar or right-click and say “add to favorites”

Hot diggity dog, it works! You can safely click YES to get past the security warning. This little fella is pretty innocuous. Happy dance, happy dance!

G’night!

This entry was posted in Techie.

4 thoughts on “Bookmarklet geeks, I need your help!

  1. Chari called me a geek! Oh, my, now THAT is a compliment for sure!

    Thing still won’t work in Netscape. Gotta figure out why.

Leave a Reply

Your email address will not be published. Required fields are marked *