Html JQuery mobile-带有两个a href标记的Ajax追加导致listview中出现错误
我通过ajax调用,其中包含两个标记,代码如下:Html JQuery mobile-带有两个a href标记的Ajax追加导致listview中出现错误,html,ajax,jquery-mobile,Html,Ajax,Jquery Mobile,我通过ajax调用,其中包含两个标记,代码如下: console.log(JSON.stringify(item)); //Inject data to the cells $('#myPostsList').append('<li class="ui-nodisc-icon" data-icon="listIcon" ><div class="behind"><a href="#myPopupDialog" dat
console.log(JSON.stringify(item)); //Inject data to the cells
$('#myPostsList').append('<li class="ui-nodisc-icon" data-icon="listIcon" ><div class="behind"><a href="#myPopupDialog" data-rel="popup" data-position-to="window" data-transition="pop" class="ui-btn delete-btn">Delete</a></div><a href="" data-myProfile='+item.myUserProfileID+' data-key='+item.myrandomPostId+'><img class="feedImage" src='+item.myPic+'></img><p><strong>'+item.myName+", "+item.myGender+'</p></strong>'
+ '<p>'+item.myPost+'<p>'
+ '<p class="ui-li-aside" ><time class="timeago" datetime='+item.myTime+'></time></p></a></li>'
);
}
});
如您所见,有两个锚定标记,a href=MyPopupDialog和a href=。第一个锚点是一个按钮,它会弹出一个窗口,而第二个标签会将您带到另一个页面
错误:
当我单击锚定标记调用弹出窗口时,它会将我带到另一个页面。我可以在链接到myPopupDialog的控制台中看到。是否有任何功能可以在单击另一个链接时禁用一个链接,反之亦然 我发现了问题。附加的标记错误,所以我在LIAN和后面的div之间以及同一div的末尾添加了“+”,现在可以使用了 后面类的CSS是什么样子的?您希望删除按钮位于何处?在通过ajax插入之前,您能让它使用普通标记吗?嗨@ezanker。我在css中的div中有以下属性:。滑动删除。在{width:100%;height:100%;position:absolute;top:0;right:0;}后面。我已经禁用了a href=所以现在没有任何链接可用,所以我假设a href正在以某种方式覆盖delete button锚定标记,因为当a href处于活动状态时,我从这两个链接中获得相同的链接,即a href=