I am new to Jquery(/ajax) and I am trying to make a google suggestion website where the user will input the string and the site will fetch the suggested data.My ajaxComplete function is executing but i am getting the following errors.
"NetworkError: 405 Method Not Allowed - http://www.google.com/complete/search?output=toolbar&q=america"
this is my code.
<script type="text/javascript"
$(document).ready(function(){ $("#submit").click(function(){ var suggestion=$("#search").val(); $.ajax({ type:"GET", url:"http://www.google.com/complete/search?output=toolbar&q="+suggestion, crossDomain:"true", ajaxComplete: $("#sugg").text("complete") //here I will put the code to retreive google suggestion.. }); }); });</script>
<form> <input id="search" name="search" placeholder="Search"> <input type="button" id="submit" name="submit" value="search"> </form> <div id="sugg">
Morever ajaxError function is not triggered.
Please help