X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f996b,5afcb992ddf2c6e5 X-Google-Attributes: gidf996b,public X-Google-ArrivalTime: 2002-07-14 06:37:07 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.tele.dk!small.news.tele.dk!193.162.153.118!news.tele.dk!not-for-mail From: "CeeJay" Newsgroups: alt.ascii-art References: <29auiu09rbq7tbsm7ldoskr11r89vm1v0i@4ax.com> <3d3095f6$0$46313$edfadb0f@dspool01.news.tele.dk> Subject: Re: [PIC][255] I wonder if I ever see you again... T-8 days Date: Sun, 14 Jul 2002 15:37:08 +0200 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Lines: 35 Message-ID: <3d317e82$0$12697$edfadb0f@dspool01.news.tele.dk> Organization: TDC Internet NNTP-Posting-Host: 131.164.157.225 X-Trace: 1026653826 dread01.news.tele.dk 12697 131.164.157.225 X-Complaints-To: abuse@post.tele.dk Xref: archiver1.google.com alt.ascii-art:18219 > "CeeJay" wrote in > message news:3d3095f6$0$46313$edfadb0f@dspool01.news.tele.dk... > > > > Here : > > > javascript:Q=document.selection.createRange().text;if(!Q){void(Q=prompt('No > > text selected on page. > > > Keywords...?',''))};if(Q)location.href='http://www.io.com/cgi-bin/dict?'+esc > > ape(Q) > > > > I think this works better, > > javascript:function trim(str) {str = this != window? this : str;return > str.replace(/^\s+/g, '').replace(/\s+$/g, > '');}Q=document.selection.createRange().text;if(!Q){void(Q=prompt('No text > selected on page. > Keywords...?',''))};if(Q)location.href='http://www.io.com/cgi-bin/dict?'+esc > ape(trim(Q)) > > Just adds a fuction trim(). This is helpful is you are in the habit > of double clicking a word to select it. For example when you use > MSIE, double clicking selects the space after the word. > This would fail in some servers like www.io.com. So > the selected word needs to be trimmed. You are right .. it is better. It would be even better if any nonletter chars were stripped. With the english language this is anything other than a -> Z