jQuery无法在AJAX Loaded页面中工作

我正在使用jQuery使用$ .ajax(假设test.html)通过AJAX加载页面。
它是一个简单的HTML文档,在单击它们时会有一些按钮和相关的动画(也使用jQuery)。
当我直接加载页面时,关联的.click()属性工作正常,但是当我在加载AJAX的版本中单击按钮时,按钮无法响应。
由于我太过疲惫,无法解释我正在做的所有闷闷不乐的事情,所以我只是编写下面的所有代码,为此道歉。 以下是文件中的必需代码。

    jQuery       

而下一个

 $(document).ready(function() { $('#results').hide(); $('#msg').hide(); $('#showButton').hide(); $('#loading').hide(); $('#loaded').hide(); $('#load').live('click', function() { $('#load').hide(); $('#loading').show(); $('#msg').show('fast'); $.ajax({ url: 'test.html', cache: false, success: function(html) { $('#results').append(html); } }); $('#msg').ajaxSuccess(function(evt, request, settings){ $(this).append('Click the Button Below to View the Page'); $('#showButton').show('slow'); $('#hideLoadedPage').hide(); $('#loading').hide(); $('#loaded').show(); }); }); $('#showLoadedPage').live('click', function() { $('#loaded').hide('slow'); $('#msg').hide('slow'); $('#results').show('fast'); $('.shower').hide(); $(this).hide(); $('#hideLoadedPage').show(); }); $('#hideLoadedPage').live('click', function() { $('#results').hide('fast'); $('.shower').hide(); $(this).hide(); $('#showLoadedPage').show(); }); $('.hider').live('click', function() { $('.shower').show(); $(this).hide(); $('p.one').hide('slow'); $('p.two').hide('medium'); $('p.three').hide('fast'); }); $('.shower').live('click', function() { $('.hider').show(); $(this).hide(); $('p.one').show('slow'); $('p.two').show('medium'); $('p.three').show('fast'); }); $('p.*').live('click', function() { $(this).hide('slow'); if( $('p').is(':hidden') ) { $('.shower').show(); } if( $('p.*').is(':hidden') ) { $('.hider').show(); } }); }); 

和最后一个

  Page Loaded by Ajax. Not the original Page    

Hiya

Such interesting text, eh?

The third Paragraph

我希望我没有犯很大的错误?

听起来像你需要的

 $('#go1').live('click', function() {}); 

$ .fn.live,因为事件处理程序仅在初始dom创建时注册,并且您正在重新填充DOM并且没有附加。

更多信息@ http://docs.jquery.com/Events/live

如果我正确读到你正在开头添加点击处理程序。 这些仅影响当前按钮。 您可能只需要将其更改为Live事件。

  $("#peopleResult_list").on('click','a', function(event){ //do you code here }); 

关于页面中当前dom的事件工作以及将来由ajax加载的任何dom