I solved this by giving the older version of jquery.min.js
Here is the working code. You need to provide the path to the search.asmx file in your SharePoint Site/Repository.
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script>
</head>
<body>
<div>
<script type="text/javascript">
// *** Customizable parameters ***
var quickSearchConfig = {
scope: "All Sites", // search scope to use
numberOfResults: 15 // number of results to show
};
$(document).ready(function () {
$('#GetList').click(function() {
//alert('sds ' + $("#quickSearchTextBox").val());
var queryXML =
"<QueryPacket xmlns='urn:Microsoft.Search.Query' Revision='1000'> \
<Query domain='QDomain'> \
<SupportedFormats><Format>urn:Microsoft.Search.Response.Document.Document</Format></SupportedFormats> \
<Context> \
<QueryText language='en-US' type='STRING' >SCOPE:\"" + quickSearchConfig.scope + "\"" + $("#quickSearchTextBox").val() + "</QueryText> \
</Context> \
<SortByProperties><SortByProperty name='Rank' direction='Descending' order='1'/></SortByProperties> \
<Range><StartAt>1</StartAt><Count>" + quickSearchConfig.numberOfResults + "</Count></Range> \
<EnableStemming>false</EnableStemming> \
<TrimDuplicates>true</TrimDuplicates> \
<IgnoreAllNoiseQuery>true</IgnoreAllNoiseQuery> \
<ImplicitAndBehavior>true</ImplicitAndBehavior> \
<IncludeRelevanceResults>true</IncludeRelevanceResults> \
<IncludeSpecialTermResults>true</IncludeSpecialTermResults> \
<IncludeHighConfidenceResults>true</IncludeHighConfidenceResults> \
</Query></QueryPacket>";
var soapEnv =
"<soap:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'> \
<soap:Body> \
<Query xmlns='urn:Microsoft.Search'> \
<queryXml>" + escapeHTML(queryXML) + "</queryXml> \
</Query> \
</soap:Body> \
</soap:Envelope>";
// Call web service
$.ajax({
url: "http://<SHAREPOINT-SITE>/_vti_bin/search.asmx",
type: "POST",
dataType: "xml",
data: soapEnv,
complete: processResult,
contentType: "text/xml; charset=\"utf-8\""
});
});
});
function escapeHTML (str) {
return str.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>');
}
function processResult(xData, status) {
//alert(xData);
//alert('xData.responseXML : ' + xData.responseXML);
//alert('In processResult ' + xData.responseXML.xml);
//alert('$(this) : ' + $(this));
//alert('$(this).text() : ' + $(this).text());
//let's see what the response looks like
//$("#response").text($(this).text());
$('#response').text(xData.responseXML.xml);
}
</script>
<ul id="data1"></ul>
<input style="width: 100px" id="quickSearchTextBox" class="ms-sbplain" title="Enter search words"
style="width: 170px" alt="Enter search words" maxlength="200" value="" />
<input type="button" id="GetList" value="GetList"/>
<div id="response" />
</div>
</body>
</html>