This documentation is for AppPresser 2 only. For AppPresser 3 docs, click here.

Make a link load via ajax

If you ever want to add a link and have it load via the ajax provided by AppPresser, simply add a class of ajaxify to the <a> tag.

Example

<a href="http://www.domain.com/custom-url/" class="ajaxify"><?php the_title(); ?></a>

Automatically load all links with ajax

If you've got lots of links in your content it can be troublesome to add the ajaxify class to everything manually. The following script will detect a page load within the app and automatically apply the ajaxify class to all links it finds within the content. This is great for getting much more predictable results with the back button however if a page is having trouble being loaded via ajax you may need to customise this script to skip certain links.

jQuery(document).on('ready load_ajax_content_done', function(){
  jQuery("#main a").addClass("ajaxify");
});