Я использую приведенный ниже код, который отлично работает для меня в FF, но проблема в IE
var lastName = "";
$(document).ready(function() {
$('#ctl00_PlaceHolderSearchArea_ctl01_S3031AEBB_InputKeywords').keyup(function(event) {
lastName = $('#ctl00_PlaceHolderSearchArea_ctl01_S3031AEBB_InputKeywords').val();
if (lastName.length < 1) {$('#Main').hide(); HideImage();}
else
{
search();
}
});
});
function search() {
var queryXML = "<QueryPacket Revision='1000'><Query><SupportedFormats><Format>urn:Microsoft.Search.Response.Document:Document</Format></SupportedFormats><ResultProvider>SharepointSearch</ResultProvider><Context><QueryText type='MSSQLFT' language='en-us'>SELECT PREFERREDNAME,FirstName,LastName,JobTitle,Department,Email,WorkEmail,WorkPhone,Skills,PictureUrl,Path,Rank,MobilePhone FROM scope() where \"SCOPE\"='People' AND ((\"JobTitle\" LIKE '%" + lastName + "%') OR (\"Skills\" LIKE '%" + lastName + "%') OR (\"LastName\" LIKE '%" + lastName + "%') OR (\"FirstName\" LIKE '%" + lastName + "%') OR (\"Department\" LIKE '%" + lastName + "%') OR (\"Email\" LIKE '%" + lastName + "%') OR (\"WorkEmail\" LIKE '%" + lastName + "%') OR (\"PreferredName\" LIKE '%" + lastName + "%'))</QueryText></Context><Range><StartAt>1</StartAt><Count>10</Count></Range><EnableStemming>true</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>";
$.ajax({
url: "/_vti_bin/search.asmx",
type: "POST",
dataType: "xml",
data: soapEnv,
complete: processResult,
contentType: "text/xml; charset=\"utf-8\""
});
function processResult(xData, status) {
$(xData.responseXML).find("QueryResult").each(function() {
var x = $("<xml>" + $(this).text() + "</xml>");
x.find("Document").each(function() {
var y = $("<xml>" + $(this).html() + "</xml>");
var pname= "";
var fname = "";
var lname = "";
var jobtitle = "";
var mphone = "";
var wemail = "";
var workphone = "";
var path = "";
var purl = "";
var title = "";
y.find("Property").each(function() {
nameElement = $(this).find("Name").text();
if (nameElement == "PREFERREDNAME") {
pname = $(this).find("Value").text();
}
else if(nameElement == "FIRSTNAME")
{
fname = $(this).find("Value").text();
}
else if(nameElement == "LASTNAME")
{
lname = $(this).find("Value").text();
}
else if(nameElement == "JOBTITLE")
{
jobtitle = $(this).find("Value").text();
}
else if(nameElement == "MOBILEPHONE")
{
mphone = $(this).find("Value").text();
}
else if(nameElement == "WORKEMAIL")
{
wemail = $(this).find("Value").text();
}
else if(nameElement == "WORKPHONE")
{
workphone = $(this).find("Value").text();
}
else if(nameElement == "PICTUREURL")
{
purl = $(this).find("Value").text();
}
else if(nameElement == "PATH")
{
path = $(this).find("Value").text();
}
else if(nameElement == "TITLE")
{
title = $(this).find("Value").text();
}
if (document.getElementById('AnsDiv') != null) {
$('#AnsDiv').remove();
}
});
});
});
}
}
function escapeHTML (str) {
return str.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>');
}