有人可以在这里提供帮助吗?
我想填充一个div,例如
<div id="contenthere"></div>
包含来自外部文件的内容,例如
/includes/about-info.html
当单击某个类别的按钮时,例如
<p class="classloader">Click Here</p>
有谁有一个快速的代码示例可以向我展示如何实现这一目标?
Use jQuery.click http://api.jquery.com/click/ and jQuery.load http://api.jquery.com/load/:
$(document).ready(function(){
$('.classloader.').click(function(){
$('#contenthere').load('/includes/about-info.html');
});
})
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)