我正在尝试使用ajax ansync get
获取搜索页面的结果$.get('http://www.dmv.org/ca-california/auto-insurance-results.php?zip=90210', function (data) {
var results = $('.ZD_9_Middlefull_centerno_blue_bar .ZD_9_Middlefull_centerno_blue_bar', $(data));
results = results.html();
console.log(results);
});
除了ie9和firefox之外,无处不在(ie10,ie8,chrome,safari)。在这两个浏览器中返回页面但没有结果。我对ajax很新,所以接下来要尝试的东西有点亏。
非常感谢任何想法
(ps:是的,选择器很奇怪,这是我唯一的选择)
答案 0 :(得分:0)
您不能对不同的来源进行ajax调用。你应该在你的后端使用curl来进行这种类型的调用。
XMLHttpRequest cannot load http://www.dmv.org/ca-california/auto-insurance-results.php?zip=90210&_=1404353517803. Origin http://stackoverflow.com is not allowed by Access-Control-Allow-Origin.