Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ajax/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 如何使用ajax获取页面?_Html_Ajax - Fatal编程技术网

Html 如何使用ajax获取页面?

Html 如何使用ajax获取页面?,html,ajax,Html,Ajax,我想得到包含一些php和html代码的页面,如下所示: 页面url:ahax.php?some=1&any=2 页面内容: <?php some php code ?> some html <?php some php ?> 一些html 我总是在用于ajax的php文件中使用“echo”,现在它包含更多的html和php代码行,使用“echo”是愚蠢的。 不确定我是否理解你想知道的。。。然而,我希望这是你正在寻找的。请澄清你的问题 另外,请看一下这个请显示您的代

我想得到包含一些php和html代码的页面,如下所示: 页面url:ahax.php?some=1&any=2 页面内容:

<?php
some php code
?>
some html
<?php
some php
?>

一些html
我总是在用于ajax的php文件中使用“echo”,现在它包含更多的html和php代码行,使用“echo”是愚蠢的。


不确定我是否理解你想知道的。。。然而,我希望这是你正在寻找的。请澄清你的问题


另外,请看一下这个

请显示您的代码。不知道您到底想知道什么。AJAX和echo之间的连接是什么?包含echo的AJAX请求的Php文件我想用AJAX获取页面。页面包含php和html代码。
<?
    $url = 'http://www.google.com';
    echo file_get_contents($url);
?>