I have a code which accept a query and uses yahoo websearch to return a suggestion.Its working fine in FF and Chrome . but in IE it gives no result. can any one help me on this??
Here is the code:
$(document).ready(function() {
$.ajax({
type: 'GET',
url: "dummyapi.php",
data: {query: "yaho"},
success: function(xml) {
alert($("Result",xml).text());
/* do something here */
},
error: function(xhr, type, exception) { alert("Error: " + type); }
});
});
dummyapi.php
$Squery = $_GET['query'];
$appid = "S8YhyGzV34HB2jaWxc9VsNIPqeeg0OwqV.WQ0IvF1lblZsUiFzlyEs12kVyH5_IT";
$u = "http://search.yahooapis.com/WebSearchService/V1/spellingSuggestion?appid=".$appid."&query=".$Squery;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $u);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$xml = curl_exec($ch);
curl_close($ch);
echo $xml;