獲取另一webage的HTML源代碼/文本是否有可能:通過JQuery的
- 從我的網頁中,獲得從其他網頁的所有HTML源代碼。我需要這樣做才能將其他頁面的html源碼傳遞給我的函數。
以下不同的嘗試不起作用:
var html = $.get("http://simplyrecipes.com/recipes/braised_turkey_legs/").html();
var html = $.get("http://simplyrecipes.com/recipes/braised_turkey_legs/");
var html = $("http://simplyrecipes.com/recipes/braised_turkey_legs/").html();
我相信你會遇到同源策略:http://en.wikipedia.org/wiki/Same_origin_policy – rossipedia