473,395 Members | 1,689 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,395 software developers and data experts.

Search tweak help

I'm trying to tweak the Google toolbar search button to do two things;
to include selected text as a string search (i.e. as though I'd entered
the text in ""), and to open a new page for the search results.

The couple of things I tried, failed, and I have hit the end of my
limited coding ability (not to mention patience!). The code is given
below - if anyone can help, I'd be most grateful.

javascript:q=document.getSelection();for(i=0;i<fra mes.length;i++){q=frames[i].document.getSelection();if(q)break;}if(!q)void(q= prompt('Keywords:',''));if(q)location.href='http://www.google.com/search?client=googlet&q='+escape(q)
Jul 23 '05 #1
2 1232
'perch wrote:
I'm trying to tweak the Google toolbar search button to do two things;
to include selected text as a string search (i.e. as though I'd entered
the text in ""), and to open a new page for the search results.

The couple of things I tried, failed, and I have hit the end of my
limited coding ability (not to mention patience!). The code is given
below - if anyone can help, I'd be most grateful.

javascript:q=document.getSelection();for(i=0;i<fra mes.length;i++){q=frames[i].document.getSelection();if(q)break;}if(!q)void(q= prompt('Keywords:',''));if(q)location.href='http://www.google.com/search?client=googlet&q='+escape(q)


is that what you mean:

javascript:Qr=document.getSelection();if(!Qr){aler t('Please highlight
text on this page to use this
function');};if(Qr){w=window.open('http://www.google.com/search?q=%22'+Qr+'%22','Google','width=480,height= 600,top=0,left=0,scrollbars=yes,resizable=yes,moda l=yes');w.focus();}

- 'modal' keeps it on top of any existing Netscape windows.

Mike
Jul 23 '05 #2
Absolutely awesome. Thank you!
mscir wrote:
'perch wrote:
I'm trying to tweak the Google toolbar search button to do two things;
to include selected text as a string search (i.e. as though I'd
entered the text in ""), and to open a new page for the search results.

YES! javascript:Qr=document.getSelection();if(!Qr){aler t('Please highlight
text on this page to use this
function');};if(Qr){w=window.open('http://www.google.com/search?q=%22'+Qr+'%22','Google','width=480,height= 600,top=0,left=0,scrollbars=yes,resizable=yes,moda l=yes');w.focus();}
- 'modal' keeps it on top of any existing Netscape windows.

Mike

Jul 23 '05 #3

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

Similar topics

1
by: BillK | last post by:
Hi - I am looking for a solution to a clients requirement. They want to distribute a database of info on CD, which user can search on selected fields and results will be displayed. The data and...
4
by: Aaron Baugher | last post by:
I have an OpenBSD 3.3 system running MySQL 3.23.55 from the ports tree. Everything started out at the default settings. This system holds a large vBulletin 2.2.9 forum database, and that's pretty...
10
by: Craig Keightley | last post by:
I have the following array: function showCPUs(){ //name brandID dualCore dualProcessor var cpuItem=; var cpuItem=; var cpuItem=; var cpuItem=; var cpuItem=; var cpuItem=; var cpuItem=;
1
by: jrs_14618 | last post by:
Hello All, This post is essentially a reply a previous post/thread here on this mailing.database.myodbc group titled: MySQL 4.0, FULL-TEXT Indexing and Search Arabic Data, Unicode I was...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.