How to create a domain bookmarklet?

Discussion in 'JavaScript' started by GeorgeB., Jan 30, 2006.

  1. #1
    Im trying to create a domain bookmarklet for Netscape/Mozilla users to be able to drag and drop a shortcut to do Whois lookups.

    So that when they click on the whois shortcut in their browser it goes to a special URL that includes the current domain they are viewing.

    EXAMPLE: http://whois-it.com/the-domain-i-see.com

    Im using javascript:location.href but that doesnt seem to work.

    Any suggestions?
     
    GeorgeB., Jan 30, 2006 IP
  2. torunforever

    torunforever Peon

    Messages:
    414
    Likes Received:
    36
    Best Answers:
    0
    Trophy Points:
    0
    #2
    <a href="javascript:location.href='http://whois-it.com/' + location.hostname">link</a>
    Code (markup):
    If I understand what you're asking. Drag that link to the Mozilla/Firefox bookmark toolbar, go to a page (e.g. www.google.com), click the bookmark, and it'll end up going to http://whois-it.com/www.google.com
     
    torunforever, Jan 30, 2006 IP
    GeorgeB. likes this.
  3. GeorgeB.

    GeorgeB. Notable Member

    Messages:
    5,695
    Likes Received:
    288
    Best Answers:
    0
    Trophy Points:
    280
    #3
    Word :)

    Thanks!

    Gave rep and what not. Others should too! :D
     
    GeorgeB., Jan 31, 2006 IP