spacer

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

home / experts / javascript / column35


Bookmarklets and Frames

Developer News
Microsoft Shows Off Silverlight 4, IE9 Plans
Metasploit Expands Vulnerability Test Framework
HyperCard Reborn?

When you run a script from a bookmark, via a bookmarklet, you are actually entering a javascript: URL in the browser's Location bar (Internet Explorer calls it an Address bar). If the current Web page in the browser's window consists of several frames, the script is executed as part of the parent window. For example, if you have a bookmarklet that counts the number of links on the current page, it will not work with a frame-based page.

If a javascript: URL appears in a link, it can refer to a specific frame if the link is located within that frame. However, if you then create a bookmarklet out of that link, you must remember that the bookmarklet executes at the topmost level of the page.

If you pay a visit to bookmarklets.com, you will notice that only some of the scripts are compatible with frame-based documents. They won't generate errors on such pages, but they won't do their job. Generally speaking, bookmarklets that deal with the content of the page will not work with frames, while those that deal with the current location or the browser's window will work flawlessly.

http://www.internet.com

Produced by Yehuda Shiran and Tomer Shiran

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
Rolling Out Your Own HTML Application Version Control · HTML 5: Client-side Storage · Working with Ajax Server Extensions
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Wi-Fi Product Watch, November 2009 · Chip Market Recovering From '08 Collapse · Low-Cost Tools to Kickstart Your New Business


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

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