这就是我的问题:如果我试图在while循环(.testt)之外加载一个div,它会工作得很好
$("#comment_area_"+n_comm_text).load("pages/userprofil.php .testt"); 但是,如果我使用相同的代码在while循环中加载一个#comment_area,它只会使div消失:
$("#comment_area_"+n_comm_text).load("pages/userprofil.php comment_area_"+n_comm_text);while循环:
<?php
$i=0;
while($row=mysqli_fetch_array($quser)){
$i++;?>
<div class="comment_area" id="comment_area_<?php echo($i);?>">
//some code
</div>
<?php } ?>我希望我的问题是清楚的,任何帮助都是非常欢迎的。谢谢
发布于 2016-11-08 00:53:52
在while循环中,确保将HTML与PHP分开。请特别注意引号和双引号,以及如何将字符串与变量连接起来。希望能有所帮助。
$i=0;
while($row=mysqli_fetch_array($quser)){
$i++;
echo '<div class="comment_area" id="comment_area_'.$i.'">';
//some code
echo '</div>';
}https://stackoverflow.com/questions/40470255
复制相似问题