views:

30

answers:

2

When we visit Stack Overflow, the IE Instant Search Dropdown button is turning orange indicating that SO can be added as a search provider.

What code should I put inside my web page for IE to detect that it's a compatible search web page?

Thank you!

A: 

Example taken right from the SO source:

<link rel="search" type="application/opensearchdescription+xml" title="Stack Overflow" href="http://sstatic.net/so/opensearch.xml"&gt;

Read more here: http://www.opensearch.org/

SleighBoy
A: 

You simply need to create an OpenSearch description document, and then include a link to it in your HTML header.

The OpenSearch doco page shows this example of a description document:

<?xml version="1.0" encoding="UTF-8"?>
 <OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"&gt;
   <ShortName>Web Search</ShortName>
   <Description>Use Example.com to search the Web.</Description>
   <Tags>example web</Tags>
   <Contact>[email protected]</Contact>
   <Url type="application/rss+xml" 
    template="http://example.com/?q={searchTerms}&amp;amp;pw={startPage?}&amp;amp;format=rss"/&gt;
 </OpenSearchDescription>

Then in your HTML header, include something like:

<link rel="search"
       type="application/opensearchdescription+xml" 
       href="http://example.com/content-search.xml"
       title="Content search" />
brianegge