Advertisement
2046

Wordpress ajaxize onclick, ajaxise_this.js

Aug 4th, 2011
458
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.62 KB | None | 0 0
  1. /* ajaxize javascript function - calls ajaxize_this on the server for the div */
  2. jQuery(document).ready( function($) {
  3.     $("#edit_this_ajax_call").click(function() {
  4.         $('div[id^="ajaxize_this"]').each( function() {
  5.                 var newquery = $.query.set('ajaxize_this', $(this).attr('id')).set('_wpnonce', ajaxizeParams._wpnonce);
  6.  
  7.                 $(this).load(location.pathname + newquery, function() {
  8.                         // renaming div id to prevent loops
  9.                         $(this).attr('id', 'loaded_' + $(this).attr('id'));
  10.                 });
  11.         });
  12.         return false;
  13.     });
  14. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement