Is it possible to pull source data from another domain (not currently owned) using jQuery Ajax method? If not any other method?
Trying to see if I can pull a specified a tag given its container (:contains). More specifically in the example below, I want to simply put an alert of how many 4-star ratings there are:
$(document).ready(function(){
$.ajax({
url: "http://www.google.com/products/seller?hl=en&q=burkett+restaurant+equipment&zmi=basequipment.com&cmi=12986189937115136&sa=X",
context: document.body,
dataType: 'html',
success: function(data){
var fourStars = $(data).find('a[href*="rate=4"]').text();
alert(fourStars);
}
});
});
You cannot access any resource outside the current domain using jQuery
ajaxmethod unless you useJSONPor any other hack.You can take a look at cross domain access with YQL and jQuery.
http://net.tutsplus.com/tutorials/javascript-ajax/quick-tip-cross-domain-ajax-request-with-yql-and-jquery/