2012-09-24 84 views

回答

3

你需要這個元標記

<link rel="search" type="application/opensearchdescription+xml" href="[your url]/opensearch.xml" title="[Your title]" /> 

您可以在這裏找到http://www.opensearch.org/Home

更多信息,您的XML文件看起來像

<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"> 
    <ShortName>[Name]</ShortName> 
    <Description>[Desc]</Description> 
    <Image height="16" width="16" type="image/x-icon">[ico]</Image> 
    <Image height="64" width="64" type="image/png">[png]</Image> 
    <Url type="text/html" method="get" template="[url]/?q={searchTerms}"/> 
    <Url type="application/opensearchdescription+xml" rel="self" template="[url]/opensearch.xml"/> 
</OpenSearchDescription> 
+0

它希望像「頁面的輸出作爲HTML「或」XML數據「? –

+0

它會使用你的普通html頁面。 ''url =「text/html」method =「get」template =「[url] /?q = {searchTerms}」/>'應該指向您的常規搜索頁面,只需替換爲{{searchTerms}查詢通常會去 –