![](/img/trans.png)
[英]Pass javascript variable to php with ajax and the result doesn't show anything
[英]Function echos variable correctly to ajax file but in html doesn't show anything
Php variable $testing
correctly echos ajax file, but in html <?php echo $testing;?>
doesn't show anything.
好的,正如評論所說,我誤解了 ajax 的工作原理。
所以它沒有顯示任何內容的答案是 - php 生成頁面和腳本,然后 ajax 腳本將數據發送到 php 文件。 要獲取 ajax 文件數據 output 我需要編寫 JS 將其放入 html - 這是另一個問題如何做到這一點。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.