0

在“加载”内容之前,如何要求 PHP 先处理和显示 html 的外层?例如,

<html>
<body>
<p>Please wait, we are processing your request</p>
<?php include 'article.php';?>
</body>
</html>

我想先在客户端浏览器上打印这个,

<html>
<body>
<p>Please wait, we are processing your request</p>

</body>
</html>

在展示这里包含的任何内容之前,

<?php include 'article.php';?>

可能吗?

4

1 回答 1

1

你可以用 Jquery 做到这一点:

<html>
<body>
<div id='article'>
   <p>Please wait, we are processing your request</p>
</div>
<script>
   $("#article").load("article.php");
</script>
</body>
</html>

.load命令从您提供的任何 URL 获取内容,并将其粘贴在命名的 DOM 元素 ( #article) 中。

阅读所有相关信息: http ://api.jquery.com/load/

于 2014-11-20T18:24:42.787 回答