jQueryをチェックアウトする必要があります。AJAX 機能の豊富な基盤があり、これらすべてを実行できるようになります。外部ページを読み込んで、直感的なCSS のようなセレクターを使用してその HTML コンテンツを解析できます。
使用例$.get();
$.get("anotherPage.html", {}, function(results){
alert(results); // will show the HTML from anotherPage.html
alert($(results).find("div.scores").html()); // show "scores" div in results
});
外部ドメインの場合、仲介者として機能するローカル PHP スクリプトを作成する必要がありました。jQuery は別のサーバーの URL を引数として渡してローカル PHP スクリプトを呼び出し、ローカル PHP スクリプトはデータを収集し、jQuery はローカル PHP スクリプトからデータを読み取ります。
$.get("middleman.php", {"site":"http://www.google.com"}, function(results){
alert(results); // middleman gives Google's HTML to jQuery
});
middleman.phpに次の行に沿って何かを与える
<?php
// Do not use as-is, this is only an example.
// $_GET["site"] set by jQuery as "http://www.google.com"
print file_get_contents($_GET["site"]);
?>