【发布时间】:2023-04-10 19:06:01
【问题描述】:
我正在使用演示中提供的 AJAX 示例使用 JQTOUCH:
$('#customers').bind('pageAnimationEnd', function(e, info){
if (!$(this).data('loaded')) { // Make sure the data hasn't already been loaded (we'll set 'loaded' to true a couple lines further down)
$('.loadingscreen').css({'display':'block'});
$(this).append($('<div> </div>'). // Append a placeholder in case the remote HTML takes its sweet time making it back
load('/mobile/ajax/customers/ .info', function() { // Overwrite the "Loading" placeholder text with the remote HTML
$(this).parent().data('loaded', true); // Set the 'loaded' var to true so we know not to re-load the HTML next time the #callback div animation ends
$('.loadingscreen').css({'display':'none'});
}));
}
});
然后返回一个很好的 UL 输出就好了..
<ul class="edgetoedge">
<li class="viewaction" id="715">
<span class="Title"><a href="/c-view/715/">Lorem Ipsum is simply dummy text of the...</a></span>
<div class="meta">
<span class="dateAdded"> 1d ago </span>
</div>
</li>
</ul>
这就是我卡住的地方。那么,当您单击上面的链接时,我该如何做到这一点,它会加载包装在 class="Title" 附近的 URL?
我希望它像第一个代码示例一样加载 JQTouch。
我尝试了以下两件事没有成功:
$('.viewaction').bind('click', function() {
alert('wow');
});
$('.viewaction').live('pageAnimationEnd', function(e, info){
});
谢谢!
【问题讨论】:
标签: javascript iphone web-applications ipad jqtouch