Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > Bookmarklets in Safari

Bookmarklets in Safari
Thread Tools
Forum Regular
Join Date: Nov 2000
Location: Oslo, Norway
Status: Offline
Reply With Quote
Jan 9, 2003, 05:00 PM
 
Has anyone had any luck using bookmarklets in Safari? It does not seem to work, not that I expect it in a pre 1.0 release.

For those of you that don't know what this is, Bookmarklets are small JavaScripts that fit in a bookmark.

Example:
Make a bookmark in Chimera (I'm sure most other browsers support this as well) edit the url to: javascript:alert("foo");

Clicking this bookmark in the Toolbar will show an alert sheet.

That is not very interesting, but this is nice:
javascript:Qr=document.getSelection();if(!Qr){void (Qr=prompt('Keywords...',''))};if(Qr)location.href ='http://www.php.net/manual-lookup.php?pattern='+escape(Qr)+'&lang=en'

This brings up a prompt with a search box for searching the PHP function reference.

There are of course many other possibilities, i.e insert todays date, insert your name and email etc.
(Last edited by beni; Jan 9, 2003 at 05:41 PM. )
     
Xeo
Moderator Emeritus
Join Date: Mar 2001
Location: Austin, MN, USA
Status: Offline
Reply With Quote
Jan 9, 2003, 05:40 PM
 
I've seen that before. I'll have to start using them. That's pretty nice.
     
Mac Enthusiast
Join Date: Dec 2000
Location: Germany
Status: Offline
Reply With Quote
Jan 9, 2003, 05:52 PM
 
I tested it (in Safari) with that foo script and it worked.
     
beni  (op)
Forum Regular
Join Date: Nov 2000
Location: Oslo, Norway
Status: Offline
Reply With Quote
Jan 9, 2003, 06:03 PM
 
Originally posted by Zadian:
I tested it (in Safari) with that foo script and it worked.
Its sure does I did not bother testing it because the PHP function search script did not work. It is because Safari encodes { } (%7B; and %7D; ) , so more complicated scripts are not possible.
     
Moderator
Join Date: Apr 2001
Location: Wasilla, Alaska
Status: Offline
Reply With Quote
Jan 9, 2003, 06:47 PM
 
Originally posted by beni:
Its sure does I did not bother testing it because the PHP function search script did not work. It is because Safari encodes { } (%7B; and %7D; ) , so more complicated scripts are not possible.
I was hoping for a workaround.. I can't tell you how many times I tried copying and pasting to make the %20 and %7B crap go away. Glad to know it's not me.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 01:01 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2