[英]php file_get_contents with ajax content
我使用file_get_contents
function 獲取網站內容。 但是它不會加載 Ajax 中顯示的內容。在 ajax 完成后,如何獲取完整內容?
echo file_get_contents("thewebsiteurl");
我的意思是在thewebsiteurl
中有一個 Ajax,並且在這個 ajax 之后顯示內容 ABC。當我使用file_get_contents
獲取thewebsiteurl
的內容時,我無法獲取 ABC 內容。
謝謝
目前尚不清楚您的意思。
我從中得到的是,您正在嘗試使用 Ajax 發送數據。 然后需要在 PHP 中處理此數據。
Ajax 為您自動使用 JSON 對數據進行編碼。 這意味着您應該使用 php 代碼
json_decode();
我希望這是您模糊問題的答案。
如果您正在尋找來自不同域的內容,這將起到作用:
$.ajax({
url:'http://www.corsproxy.com/' +
'en.wikipedia.org/wiki/Briarcliff_Manor,_New_York',
type:'GET',
success: function(data){
$('#content').html($(data).find('#firstHeading').html());
}
});
謝謝
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.