我想在div中动态显示一些内容。这些内容来自于我在php中的一个函数。
你知道我该怎么做吗?
HTML:
<div class="creativeSecondField">
<h1 class="secondFieldTitle"></h1>
<div class="secondFieldContent"></div>
</div>JQUERY:
$(".creativeSecondField > div.secondFieldContent").text(""+
<?php
$info+this.id = $this->sqlCategories+this.id;
foreach ( $info+this.id as $valuesinfo+this.id )
{
echo $valuesinfo+this.id['designation_en'];
}
?>
+"");发布于 2014-07-14 01:42:49
首先创建一个php页面,它返回一个动态内容,比如
getContent.php
<?php
echo "hello";
?>之后,在您希望使用jquery显示动态内容的页面上,如下所示
<div class="creativeSecondField">
<h1 class="secondFieldTitle"></h1>
<div class="secondFieldContent"></div>
</div>
<script>
$(document).ready(function() {
$(".secondFieldTitle").load("getContent.php");
});
</script>使用它谢谢..。
https://stackoverflow.com/questions/24725408
复制相似问题