jQuery:Parsing an ajax HTML page result with jQuery -


it seems there lot of entries exist that, cant find silver bullet solve problem.

basically want ajax way show google search results on page, made sample page code following:

<html>   <head>   <title>baidu</title> <script type="text/javascript" src="http://code.jquery.com/jquery-1.7.min.js"></script> </style> <script> $(document).ready(function() {     var obj =          $.ajax({             url:"https://www.google.com/search?q=stackoverflow"         });     alert(obj); }); </script> <body> </body>   </html> 

after got [object object].so question :

  1. what did , how parse it?
  2. in condition,which parameters should set method jquery.ajax()?

due same origin policy, can't make ajax call google because domain different of code.

suggested solution proxy request through server side script resides on same domain, , either make http request search results or use custom search api.


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -