spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / experts / javascript / column35


Creating Bookmarklets

Developer News
Metasploit 3.2 Offers More 'Evil Deeds'
'Thank You Apple. Seriously.'
The Buzz: BlackBerry App Store Seen Next

As you already know, any hypertext link can be used in the form of a bookmark. The same rule applies to javascript: links, so you can actually create a bookmark that executes JavaScript code -- a bookmarklet. The following link displays an alert box and loads a Web page: Doc JavaScript.

If you're running Windows, right-click the link and select "Add Bookmark" (Navigator) or "Add to Favorites..." (Internet Explorer). If you're working on a Macintosh, hold the mouse button over the link until the menu appears, and create a bookmark. Due to a bug in the Macintosh version of Navigator, the bookmark's name may not show up properly. Rather than using the link's text as the name of the bookmark, the browser uses the URL for some reason. The specific bookmark can be edited by pressing Option+B (Bookmarks), selecting the desired bookmark, and then pressing Option+I (Get Info).

There are other ways to create bookmarks. In Navigator, open the Bookmarks window, and select the "New Bookmark..." option from the File menu. Then enter the desired name and URL for the bookmark. In Internet Explorer you will need to do some hacking. Locate the Favorites folder, and create a new file for the desired bookmark. We suggest that you stick to the standard "Add Bookmark" or "Add to Favorites..." option.

Executing JavaScript from a bookmark is great, but running a script from a permanent button is even better. By dragging a javascript: link to Navigator's Personal Toolbar or Internet Explorer's Links bar, you can present a JavaScript-powered button in your browser. You can add a button to Navigator's Personal Toolbar by creating a bookmark in its folder. For more information, refer to Netscape's JavaScript Guide.

Note that the Macintosh version of Navigator 4.5 features a Personal Toolbar, but previous versions do not. You should also know that the Links bar in the Macintosh version of Internet Explorer 4.0x causes some trouble, so you may find it difficult to use.

When you trigger a bookmarklet, you are actually running a script on the current page. Therefore, you cannot use a bookmarklet to access properties of a document in another window, belonging to a different site. These are simply security precautions that are typical to JavaScript.

http://www.internet.com

Produced by Yehuda Shiran and Tomer Shiran


JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Solutions
Whitepapers and eBooks
IBM Whitepaper: Innovative Collaboration to Advance Your Business
Internet.com eBook: Real Life Rails
Avaya Article: Call Control XML - Powerful, Standards-Based Call Control
Tripwire Whitepaper: Seven Practical Steps to Mitigate Virtualization Security Risks
Internet.com eBook: The Pros and Cons of Outsourcing
Go Parallel Article: Scalable Parallelism with Intel(R) Threading Building Blocks
Internet.com eBook: Best Practices for Developing a Web Site
IBM CXO Whitepaper: The 2008 Global CEO Study "The Enterprise of the Future"
Avaya Article: Call Control XML in Action - A CCXML Auto Attendant
Go Parallel Article: James Reinders on the Intel Parallel Studio Beta Program
IBM CXO Whitepaper: Unlocking the DNA of the Adaptable Workforce--The Global Human Capital Study 2008
Adobe Acrobat Connect Pro: Web Conferencing and eLearning Whitepapers
Go Parallel Article: Getting Started with TBB on Windows
HP eBook: Storage Networking , Part 1
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
Webcasts
Go Parallel Video: Intel(R) Threading Building Blocks: A New Method for Threading in C++
HP Video: Is Your Data Center Ready for a Real World Disaster?
Microsoft Partner Portal Video: Microsoft Gold Certified Partners Build Successful Practices
HP On Demand Webcast: Virtualization in Action
Go Parallel Video: Performance and Threading Tools for Game Developers
Rackspace Hosting Center: Customer Videos
Intel vPro Developer Virtual Bootcamp
HP Disaster-Proof Solutions eSeminar
HP On Demand Webcast: Discover the Benefits of Virtualization
MORE WEBCASTS, PODCASTS, AND VIDEOS
Downloads and eKits
Microsoft Download: Silverlight 2 Software Development Kit Beta 2
30-Day Trial: SPAMfighter Exchange Module
Red Gate Download: SQL Toolbelt
Iron Speed Designer Application Generator
Microsoft Download: Silverlight 2 Beta 2 Runtime
MORE DOWNLOADS, EKITS, AND FREE TRIALS
Tutorials and Demos
IBM IT Innovation Article: Green Servers Provide a Competitive Advantage
Microsoft Article: Expression Web 2 for PHP Developers--Simplify Your PHP Applications
Featured Algorithm: Intel Threading Building Blocks - parallel_reduce
MORE TUTORIALS, DEMOS AND STEP-BY-STEP GUIDES
webref The latest from WebReference.com Browse >
Popular JavaScript Framework Libraries: An Overview · Controllers: Programming Application Logic - Part 2 · How to Use JavaScript to Validate Form Data
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Choosing the Right Online Backup Provider · Mother Avaya Nurtures Her Technology Partners · Software as a Service a Winning Model for Hotspot Provider


Created: February 1, 1999
Revised: February 1, 1999

URL: http://www.webreference.com/js/column35/creating.html