javascript - JQTOUCH,绑定(bind)到通过 AJAX 拉入的链接,进行另一个 AJAX 调用?可能的?

标签 javascript iphone web-applications ipad jqtouch

我正在使用演示中提供的 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){

});

谢谢!

最佳答案

把这个放在你的第一个绑定(bind)函数之外的地方

$("span[class=Title]").delegate("a", "click", function(){
    alert('LOLCAT');
});

关于javascript - JQTOUCH,绑定(bind)到通过 AJAX 拉入的链接,进行另一个 AJAX 调用?可能的?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2605153/

相关文章:

iPhone 应用程序 - Google plus share with pre-fill text

android - Android 上的离线 Web 应用程序 HTML5

javascript - 动态创建的文本字段的不同行为

javascript - jQuery 如果表单字段的值的一部分与数组中的值匹配,则

iphone - 从用户在 iOS 上设置的时间获取 AM/PM

web-applications - 我应该下订单还是等待付款?

java - 将 RequestAttributes 传递给新线程后, session 丢失

javascript - 将 JavaScript 侧边导航菜单更改为从右到左动画

javascript - D3饼图未更新

iphone - CGImageDestination 和文件命名问题