bookmarklet

M

mkengel

I would appreciate receiving some help:

I have a bookmarklet which copies a marked set of characters into a
searchpage in our dictionary. If nothing is copied, a window opens
where you can type a word.

BTW, it is for firefox 2.0.

javascript:s=window.getSelection();if(s=='')for(i=0;i<frames.length;i++){s=frames.document.getSelection();if(s)break;}if(!s)void(s=prompt('some
text.',''));if(s){test=open('URL/search.pl?searchphrase='+escape(s));test.focus();}
This works well.

We have another search /command which needs to be finished with
&search= after the searchphrase

searchphrase="here comes the markedtyped set of characters"&search=

Can anyone of you help me changing the bookmarklet or point me to a
site where I can read more about this ?

If you have an idea how to make the script shown above better, I also
would appreciate very much.

Thank you

Michael
 
R

Randy Webb

mkengel said the following on 1/21/2007 6:28 AM:
I would appreciate receiving some help:

I have a bookmarklet which copies a marked set of characters into a
searchpage in our dictionary. If nothing is copied, a window opens
where you can type a word.

BTW, it is for firefox 2.0.

javascript:s=window.getSelection();if(s=='')for(i=0;i<frames.length;i++){s=frames.document.getSelection();if(s)break;}if(!s)void(s=prompt('some
text.',''));if(s){test=open('URL/search.pl?searchphrase='+escape(s));test.focus();}
This works well.

We have another search /command which needs to be finished with
&search= after the searchphrase

searchphrase="here comes the markedtyped set of characters"&search=


Change your if(s) statement (the last one) to something like this:

test=open('URL/search.pl?searchphrase='+escape(s) + '&search=');
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,059
Latest member
cryptoseoagencies

Latest Threads

Top