code: function ajaxCallback(page, ph, oldUrl, options, callback) {
      // callback for page change
      switch(options) {
          case 1:
              // expect ajax
              pageDomHasChanged(page, ph, function (error, page, ph) {
                  callback(error, page, ph);
              });
              break;
          case 2:
              // expect navigation
              pageHasChanged(page, oldUrl, function (error) {
                  callback(error, page, ph);
              });
              break;
          default:
              // callback immediately
              callback(null, page, ph);
              break;
      }
  }
docs: Waits for a callback based on the options
  @param page
  @param ph
  @param oldUrl
  @param options
  @param {pageCallback} callback