Search tweak help

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • 'perch

    #1

    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=do cument.getSelec tion();for(i=0; i<frames.length ;i++){q=frames[i].document.getSe lection();if(q) break;}if(!q)vo id(q=prompt('Ke ywords:',''));i f(q)location.hr ef='http://www.google.com/search?client=g ooglet&q='+esca pe(q)
  • mscir

    #2
    Re: Search tweak help

    'perch wrote:
    [color=blue]
    > 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=do cument.getSelec tion();for(i=0; i<frames.length ;i++){q=frames[i].document.getSe lection();if(q) break;}if(!q)vo id(q=prompt('Ke ywords:',''));i f(q)location.hr ef='http://www.google.com/search?client=g ooglet&q='+esca pe(q)[/color]

    is that what you mean:

    javascript:Qr=d ocument.getSele ction();if(!Qr) {alert('Please highlight
    text on this page to use this
    function');};if (Qr){w=window.o pen('http://www.google.com/search?q=%22'+Q r+'%22','Google ','width=480,he ight=600,top=0, left=0,scrollba rs=yes,resizabl e=yes,modal=yes ');w.focus();}

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

    Mike

    Comment

    • 'perch

      #3
      Re: Search tweak help

      Absolutely awesome. Thank you!


      mscir wrote:[color=blue]
      > 'perch wrote:
      >[color=green]
      >> 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.[/color]
      >[/color]
      YES![color=blue]
      > javascript:Qr=d ocument.getSele ction();if(!Qr) {alert('Please highlight
      > text on this page to use this
      > function');};if (Qr){w=window.o pen('http://www.google.com/search?q=%22'+Q r+'%22','Google ','width=480,he ight=600,top=0, left=0,scrollba rs=yes,resizabl e=yes,modal=yes ');w.focus();}
      >
      >
      > - 'modal' keeps it on top of any existing Netscape windows.
      >
      > Mike[/color]

      Comment

      Working...