如何让thinkphp5的HTML文件怎么显示{} 30
1个回答
展开全部
引入代码如下:
1,主界面index.html
代码:
标签:
<div id="main" >
</div>
<button id="btn">点击</button>
js:
<script>
$("#btn").click(function() {
$.post('__URL__/show', function(data) {
$(document).ready(function(){$("#main").html(data);})
});
});
</script>
2,show.html网页
<div id="div2">
<h3>aaaaaa</h3>
<h3>aaaaaa</h3>
<h3>aaaaaa</h3>
<h3>aaaaaa</h3>
<h3>aaaaaa</h3>
</div>
3, IndexAction.class.php
public function show(){$this->display();}
结果:
<div id="main" >
<div id="div2">
<h3>aaaaaa</h3>
<h3>aaaaaa</h3>
<h3>aaaaaa</h3>
<h3>aaaaaa</h3>
<h3>aaaaaa</h3>
</div>
</div>
<button id="btn">点击</button>
1,主界面index.html
代码:
标签:
<div id="main" >
</div>
<button id="btn">点击</button>
js:
<script>
$("#btn").click(function() {
$.post('__URL__/show', function(data) {
$(document).ready(function(){$("#main").html(data);})
});
});
</script>
2,show.html网页
<div id="div2">
<h3>aaaaaa</h3>
<h3>aaaaaa</h3>
<h3>aaaaaa</h3>
<h3>aaaaaa</h3>
<h3>aaaaaa</h3>
</div>
3, IndexAction.class.php
public function show(){$this->display();}
结果:
<div id="main" >
<div id="div2">
<h3>aaaaaa</h3>
<h3>aaaaaa</h3>
<h3>aaaaaa</h3>
<h3>aaaaaa</h3>
<h3>aaaaaa</h3>
</div>
</div>
<button id="btn">点击</button>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询