How to create search engine with two parameters in Opera?
Friday, 15. February 2008, 09:13:22
Sometimes we need to specify two parameters for search as in the following search.
http://images.google.com/images?imgtype=face&q=monkey
It is possible to create search engine for the above using JavaScript.
By creating a search engine with the following JavaScript in address field, you can search Google Images from address bar by typing <search engine keyword><space><search parameter 1><space><search parameter 2> (example: gi face monkey)
javascript:var s='%s';var p=s.indexOf('+');if(p>-1){var s1=s.split('+');var s2=s.slice(p+1)};window.location.href='http://images.google.com/images?imgtype='+s1[0]+'&q='+s2;
To create search engine for another site, modify images.google.com/images?imgtype='+s1[0]+'&q='+s2; part in the above JavaScript. When you perform search, s1[0] will be replaced by first parameter & s2 with second parameter.
If <search parameter 1> is more than one word use the following JavaScript. Use dot instead of space as separtor between search parameters.
javascript:var s='%s';var p=s.indexOf('.');if(p>-1){var s1=s.split('.');var s2=s.slice(p+1)};window.location.href='http://images.google.com/images?imgtype='+s1[0]+'&q='+s2;
Update: Apr 28, 2008









vd2k # 16. February 2008, 11:38
I created my own custom search straight away: Google Maps Directions.
javascript:var s='%s';var p=s.indexOf('+');if(p>-1){var s1=s.split('+');var s2=s.slice(p+1)};window.location.href='http://maps.google.nl/maps?f=d&hl=en&geocode=&saddr='+s1[0]+'&daddr='+s2;Tamil # 16. February 2008, 18:06
Gesu` # 23. February 2008, 08:29
I'm trying to create a search engine for Torrentz.com using your method but I can't figure out why my solution does not work.
A usual link of this search engine is:
http://torrentz.com/search?q=foo+bar
So I create this entry:
javascript:var s='%s';var p=s.indexOf('+');if(p>-1){var s1=s.split('+');var s2=s.slice(p+1)};window.location.href='http://torrentz.com/search?q='+s1[0]'+'+s2;
Looks like it doesn't accept the "+" between the two strings and I can't understand why. Any ideas?
Thanks in advance :-)
Tamil # 23. February 2008, 08:45
Originally posted by Gesu`:
You didn't place + after s1[0]Simple & easy one
Gesu` # 23. February 2008, 15:58
I suppose that the site has changed its behaviour because in the past I used the "simple solution" and it didn't work. And I'm pretty sure it was that same exact string.
Anyway, thanks again!
MAGDALENA1 # 17. April 2008, 15:58
MR-NF # 15. May 2008, 16:52
Percy Shroff # 2. July 2008, 13:21
nizamx # 4. July 2008, 16:28
Tamil # 4. July 2008, 16:38
nizamx # 4. July 2008, 17:13
I put that search field to Opera's toolbar.
Tamil # 4. July 2008, 17:19
nizamx # 4. July 2008, 17:49
Tamil # 4. July 2008, 17:55
Originally posted by nizamx:
AFAIK, not possible with search field.@Percy Shroff, AFAIK it is not possible.
Percy Shroff # 20. July 2008, 10:53
URL=javascript:var s='%s';window.location.href='Page with %s Susbstitued by '+s+';open('Page with %s Susbstitued by '+s+'');open('Page with %s Susbstitued by '+s+'');
Anonymous # 10. October 2008, 00:09
Hello Tamil. Are there any way to assign favicons to these search boxes with javascript address? Thank you!
Tamil # 10. October 2008, 11:29
Anonymous # 14. May 2009, 14:20
Help me icant download with my opera 4.2 in 2 my n72 mobile phone
Tamil # 22. May 2009, 08:42