jquerydom.$。html
此链接也有jquery事件<代码>$(“a[href=#editInfo]”)。单击 但事件未被触发 如果将此链接放置在浏览器直接加载的位置(无DOM),则此链接有效。 通过DOM附加的链接不起作用:( 我怎么能修好它 对不起,我的英语不好。将“”添加到搜索属性值。jquerydom.$。html,jquery,html,dom,Jquery,Html,Dom,此链接也有jquery事件$(“a[href=#editInfo]”)。单击 但事件未被触发 如果将此链接放置在浏览器直接加载的位置(无DOM),则此链接有效。 通过DOM附加的链接不起作用:( 我怎么能修好它 对不起,我的英语不好。将“”添加到搜索属性值。 试试这个: <div class="row"> <li><a href="#editInfo">Change information</a></li> </div>
试试这个:
<div class="row">
<li><a href="#editInfo">Change information</a></li>
</div>
据我所知,
#editInfo
链接在加载页面时不存在,而是在单击#profile
时加载。这意味着editInfo
是一个动态元素,因此需要使用
$(“a[href='#editInfo'])。单击(函数(){仍然不起作用:(
<div class="row">
<li><a href="#editInfo">Change information</a></li>
</div>
$("a[href='#sign-in']").click(function(){
$.post("/index.php/start_ctrl/signin", function(data){
$("body>div.row").html(data);
})
})
$("a[href='#profile']").click(function(){
$.post("/index.php/profile_ctrl/profile", function(data){
$("body>div.row").html(data);
})
})
$("a[href='#editInfo']").click(function(){
$.post("/index.php/profile_ctrl/editinfo", function(data){
$("div.profilepanel").html(data);
})
})
$(document).on('click', "a[href=#editInfo]", function () {
$.post("/index.php/profile_ctrl/editinfo", function (data) {
$("div.profilepanel").html(data);
})
})