Web上にWebページがあるとすると、このページにはIDを持つ多くの要素があります。javascriptを使用してこれらの要素をフェッチするにはどうすればよいですか?私はこのチャンクをjQueryで使用しました:
$.get(websiteUrl, {}, function(results){
//alert(results); // will show the HTML from anotherPage.html
console.log($(results).find("bookId").html()); // show "bookId" div in results
});
しかし、エラーが発生します:
XMLHttpRequest cannot load; Origin http://127.0.0.1:8000 is not allowed by Access-Control-Allow-Origin.
実際、AndroidのPhonegapアプリのウェブページからデータを取得しようとしています。これを行う方法はありますか?