Skip to content

Instantly share code, notes, and snippets.

@irobinson
Created February 2, 2011 00:41
Show Gist options
  • Save irobinson/807037 to your computer and use it in GitHub Desktop.
Save irobinson/807037 to your computer and use it in GitHub Desktop.
Example of using xdomainajax plug-in to parse results from search page.
var targetUrl = 'http://site.to.search.com/?query=' + encodeURIComponent(searchPhrase); // important to encode user input
$.get(targetUrl, function (res) { // relies on xdomainajax plugin
var totalResults = $(res.responseText).find('#parse .the-results .per-usual').html();
});
window.open(targetUrl);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment