MODX Cloud

The Most Productive MODX Learning Playground Ever

Claim Free Lab Account

tpl.PageBreaker.ajax

Skip to end of metadata
Go to start of metadata

Description

This chunk used only if you enable pb_ajax parameter of PageBreaker plugin.

It is simply handle clicks on links with class load_page and sends ajax request to current page. After receiving response from plugin it changes old text block to new.

You need to specify id of element on webpage where content is.

<script type='text/javascript'>
  var elem = '#content'; // HTML element on webpage in which will be loaded new block of text

  $(document).ready(function() {
    $('.load_page').live('click', function() {
      var href = $(this).attr('href');
      $.post(href, {'action': 'PageBreakLoad'}, function(data) {
	      $(elem).html(data);
      })
      return false;
    })
  })

</script>

Placeholders

There is no unusual placeholders in this chunk.

See Also

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.