google cse - How do browsers' Search boxes work? -


I should know exactly how the search box works on browsers. I want to change things like Wikipedia and Google with customized search engines here on mathematics. You can see them in iGoogle, therefore:

How can I add Google CSE to the browser's search box?

You can say "search provider" for your sites Search page that accepts search URLs as a query string in your URL, such as

  http://www.example.com/search?q=meaning+of+ life < / Code> 

This should work with Google Custom Search.

You have to create a special XML file (call it SearchProvider.xml , for example) and place it on your web server:

  & Lt ;? Xml version = "1.0" encoding = "UTF-8"? & Gt; & Lt; OpenSearchDescription xmlns = "http://a9.com/-/spec/opensearch/1.1/" & gt; & Lt; ShortName & gt; Example search provider & lt; / ShortName & gt; & Lt; Details & gt; Find answers to the most important questions of the universe & lt; / Description & gt; & Lt; InputEncoding & gt; UTF-8 & lt; / InputEncoding & gt; & Lt; Url type = "text / html" template = "http://www.example.com/search?q={searchTerms}"/> & Lt; / OpenSearchDescription & gt;  

Then, you will need to insert a special link tag in the header section of your page:

  & lt; Link title = "Example search provider" rel = "search" type = "application / office subscription = xml" href = "http://www.example.com/SearchProvider.xml" />  

You can also add a link to your page, which allows your users to add search providers to the browser:

  & lt ; A href = "#" onclic = "javascript: window.external.AddSearchProvider ('http://www.example.com/SearchProvider.xml');" & gt; Example search provider & lt; / A & gt;  

Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -