我DOM
如下,
<div id='level-1'>
<ul>
<li><span><a>Mike</a></span></li>
<li><span><a>John</a></span></li>
<li><span><a>Ket</a></span></li>
</ul>
</div>
jQuery
如下,
$(document).on('click','div[id^=[level] ul li span a',function(){
//Making ajax request,no problem in getting the response
// Here I need to append response next to the current div i,e div#level-1 or div#leve-2
});
ajax
DOM
除了id
的div
和 内容外,响应将与上述相同anchor tag
。id
将是level-2
或level-3
我,即。+1
到 div 的当前值。