Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'generic use of this' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
generic use of this
Authored by: Krioni on Sep 23, '02 01:53:52PM
I took mithra's example, and made a generic version (formatted-should be a single line - no returns or spaces):

javascript:promptMsg='TYPE YOUR PROMPT MESSAGE HERE:';
actionURL='URL BEFORE SEARCH TERM';q=document.getSelection();
for(i=0;i<frames.length;i++){q=frames[i].document.getSelection();
if(q)break;}if(!q)void(q=prompt(promptMsg,''));
if(q)location.href=actionURL+escape(q)

Change the two places in that code, and then you can put in any search/terms pair.

Here's an example that searches VersionTracker for OS X software (formatted-should be a single line - no returns or spaces):

javascript:promptMsg='VersionTrackerX Search Terms:';
actionURL='http://www.versiontracker.com/mp/new_search.m?
productDB=mac&mode=Quick&OS_Filter=MacOSX&search=';q=document.getSelection();
for(i=0;i<frames.length;i++){q=frames[i].document.getSelection();
if(q)break;}if(!q)void(q=prompt(promptMsg,''));
if(q)location.href=actionURL+escape(q)

Search VersionTracker X

[ Reply to This | # ]