gpt4 book ai didi

jquery - 使用 jquery click() 加载 url

转载 作者:行者123 更新时间:2023-12-01 07:25:37 26 4
gpt4 key购买 nike

我的代码是:

$(document).ready(function(){   

//alert('hi');
$('#call1').click(function(){

$.('#text').load('click1.html')
})

$('#call2').click(function(){

$.('#text').load('click2.html')
})

$('#call3').click(function(){

$.('#text').load('click3.html')
})
})

HTML

<div id="call1">click 1</div>
<div id="call2">click 2</div>
<div id="call3">click 3</div>
<p>&nbsp;</p>
<div id="text">sdfsdfs</div>

我想加载#text中的html页面当用户点击#call1时, #call2 ,或#call3 .

最佳答案

尝试使用 $('#text') 而不是 $.('#text') :)

关于jquery - 使用 jquery click() 加载 url,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9850948/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com