10 November 2005

What's in a window.name?

I am interested in using accessible javascript properties to store information using bookmarklets between posts, in order to build up the information that will be used to post the bookmark. For example, visit a page, select a word or phrase, and click a bookmarklet to append that to a list of tags, and repeat for each tag or tag phrase; then, select some text to be used for the extended description and click another bookmarklet, and voila, it uses the value set in the first call to complete the post.

My initial thought is to use the windows.name property, which is not normally used (except for windows opened by open() and those called with TARGET.

From http://www.anaesthetist.com/mnm/javascript/part3.htm:

window.name - JavaScript generally makes little distinction between windows and frames; you'll find that it's generally important to name a frame that you create (or a window that you open) so that later on such objects can talk to one another!

An obvious question is, why not just use a global variable?…


This page is powered by Blogger. Isn't yours?