thinkphp中html页面怎么引入html页面?
引入代码如下:
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>