简体   繁体   English

Function 将变量正确回显到 ajax 文件,但在 html 中不显示任何内容

[英]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. Php variable $testing correctly echos ajax file, but in html <?php echo $testing;?> doesn't show anything.

Okay as the comments says I missunderstood how ajax works.好的,正如评论所说,我误解了 ajax 的工作原理。

So the answer why it doesnt show anything is - php generates page and script and then the ajax script sends data to php file.所以它没有显示任何内容的答案是 - php 生成页面和脚本,然后 ajax 脚本将数据发送到 php 文件。 To get ajax file data output I need to write JS which gonna put it into html - which is another question how to do that.要获取 ajax 文件数据 output 我需要编写 JS 将其放入 html - 这是另一个问题如何做到这一点。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM