0
所以我试图加载与我的主页在同一文件夹中的页面,并且它不会在点击时加载。也许我的代码有问题。我知道这是因为我用警报检查它。Div内容无法加载点击
代码波纹管。
<script>
function closeIt() {
e.preventDefault();
$("#load-here").load($(this).attr('secound.html'));
};
</script>
<div id="buttons" >
<form>
<button class="btn" onClick="closeIt()" >secound</button>
</form>
</div>
<div id="load-here">
hehehe
</div>
您有一个名为'closeIt'的函数,它通过ajax加载内容? '$(this).attr('secound.html')'应该做什么? (http://api.jquery.com/attr/) – Pevara 2014-09-06 21:02:00
即时消息不使用ajax; /也许我应该使用ajax? – vivid 2014-09-06 21:22:01
你正在使用ajax,加载基本上只是一个简写。我实际上指的是可怜的名字选择,你没有关闭任何东西...... – Pevara 2014-09-06 21:24:31