会有人能帮助这里吗?
我想填补一个div例如
I would like to fill a div e.g.
<div id="contenthere"></div>
从外部文件例如内容。
with content from an external file e.g.
/includes/about-info.html
点击例如,使用某一类按钮时
when a button with a certain class is clicked e.g.
<p class="classloader">Click Here</p>
有没有人有一个快速的code例如,它们可以告诉我取悦实现这一目标?
Does anyone have a quick code example they can show me please to achieve this?
非常感谢。
使用 jQuery.click
和 jQuery.load
:
$(document).ready(function(){
$('.classloader.').click(function(){
$('#contenthere').load('/includes/about-info.html');
});
})