473,406 Members | 2,847 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

bookmarklet

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[i].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

Jan 21 '07 #1
1 1178
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[i].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=');

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Jan 21 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Gaikokujin Kyofusho | last post by:
Hi, I am trying to find a wikipedia bookmarklet for Opera that would allow me to lookup something highlighted on a page. I could have sworn that the one i had worked until i had to reinstall opera...
1
by: Robert Oschler | last post by:
In pre-Windows XP Internet Explorer, adding a bookmarklet for a user was really simple. All I add to do was create a link that executed addFavorite(). Internet Explorer under Windows XP won't...
4
by: gwtc | last post by:
Here is a google search site bookmarklet. This lets you search a certain website using google. What I want is the same thing, but to search a certain geocities site. When you use the current...
1
by: OtisUsenet | last post by:
Hi, I have a bookmarklet that works perfectly in Firefox, IE, Konqueror, and Opera, but in Safari 2.0.3 (417.9.2) it doesn't work. I enabled debugging and I can see "TypeError - Undefined...
2
by: Smugsboy | last post by:
Hi, Got a problem here. I'm trying to create a bookmarklet on IE6, that passes the outerHTML of the body element as a GET param my site. The problem is that for some page (ie mail.yahoo.com) the...
25
by: bweaverusenet | last post by:
Hi. I am trying to get some javascript to work in IE6, from the address line. It works in Firefox and, I believe, IE7. It appears that with some number of nested structures, the code does not...
7
by: Amir Michail | last post by:
Hi, I would like to add a submission bookmarklet to my app that takes the current selection and pastes it into the app's rich text editor while preserving formatting. It should work in at least...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.