2012-04-14 55 views
0

我試圖從Google搜索中「跨域」獲取數據。我想出了PHP,但我不想使用它。我想直接使用JavaScript獲取數據。但是如何? JSONP?或其他?如何跨域從Google搜索中獲取數據

+0

相關:http://stackoverflow.com/questions/3076414/ways-to-circumvent-the-same-origin-policy – 2012-04-14 18:08:42

+0

您可能想使用Google的自定義搜索API,請參閱:[link](http://stackoverflow.com/questions/6978242/how-to-load -googles-custom-search-enginecse-js-apis-after-page-loads) – dennisg 2012-04-14 18:12:40

回答

1

你可以通過AJAX使用谷歌搜索API,像jQuery.get(),因爲谷歌的JavaScript API第繞過跨域安全的AJAX

+0

我現在正在使用YQL從其他域取數據(你可能已經意識到這個問題很老了)。無論如何,我會接受你的答案,因爲你是過去一年中唯一回答的人。 ;) – 2013-01-16 08:18:43

+0

一個星期前我打電話給ajax的谷歌自定義搜索API,所以我想知道如何劑量谷歌JavaScript api繞過cross-domain.not jsonp,什麼是...我在堆棧搜索,然後我看到你的問題。 – 2013-01-16 08:26:30

+0

我認爲使用'