Using ajaxComplete in view pagination I have (drupal 7) view where I have pagination with Ajax enabled.
When any pager item is clicked I want to perform certain thing after the view is reloaded with ajax.
I am trying the following code:

(function($){
Drupal.behaviors.myBehavior = {
    attach: function (context, settings) {
    $(document).ajaxComplete(function( event, request, settings ) {
        console.log("Ajax Completed");
    });
   }
 };


})(jQuery);


There is no output form console.log(). What am I doing wrong ?
I found a solution here. Based on @djayp34's answer, this is how I achieved what I wanted.

Basically the idea is:
Drupal does not support adding a JS snippet through drupal_add_js() or any other function at AJAX callback. So what we are doing here is:

Step 1: We register/load that particular JS code during normal page load.
In template.php:

function MYTHEME_preprocess_html(&amp;$vars) {
  drupal_add_js(
    'Drupal.ajax.prototype.commands.myFunction = function(ajax, response, status){
       //The JS code that needs to be called after completion of ajax
      }',
      'inline'
     ); 
}


Step 2: We call that JS code when we want it. Here we want it to be called during AJAX callback.

In module file.

function MYMODULE_views_ajax_data_alter(&amp;$commands, $view){
  if($view-&gt;name == 'MY_VIEW'){
    $commands[] = array("command" =&gt; 'myFunction'); 
  }
}