Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

javascript to search on highlighted word

Status
Not open for further replies.

saw

Technical User
Oct 6, 2000
14
US
Javascript gurus,
I had found some javascript code somewhere that you put in the location URL of a Netscape Personal Toolbar Button. When you highlight an address and press the toolbar button, it pulls up a MapQuest map of that address, or if nothing is highlighted, it prompts the user for an address. It works fine in Netscape, but I want to use it in an IE Links button. When I tried pasting the code into the URL of an IE Links button and pressed the button, I get an error like: "Error: Object doesn't support this property or method."
thanks for any help!
Scott

Here's the code for the Netscape button.
********************************************
javascript:Qr=document.getSelection();if(!Qr){void(Qr=prompt('Enter address to find at MapQuest:',''))}if(Qr)location.href=' Zip=&Find+Map=Get+Map&address='+escape(Qr)+' '
********************************************


------------------
Scott Wallace
Systems Administrator
Ternion Corporation
saw@ternion.com

[sig][/sig]
 
rycamor submitted a post today that answers your question. Basically, you need to write two different routines - one for IE, one for Netscape. Do a search of this forum on &quot;getselection&quot;. [sig]<p>nick bulka<br><a href=mailto: > </a><br><a href= </a><br>[/sig]
 
That will work! Thank you very much!

saw [sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top