b2evolution PHP Cross Reference Blogging Systems

Source: /rsc/js/ajax.js - 47 lines - 1183 bytes - Summary - Text - Print

Description: This file is part of the evoCore framework - {@link http://evocore.net/} See also {@link http://sourceforge.net/projects/evocms/}.

   1  /**

   2   * This file is part of the evoCore framework - {@link http://evocore.net/}

   3   * See also {@link http://sourceforge.net/projects/evocms/}.

   4   * @version $Id: ajax.js 13 2012-14-01 23:42:53Z fplanque $

   5   */
   6  
   7  
   8  /**

   9   * Clear ajax request from debug text

  10   *

  11   * @param string AJAX Response text

  12   * @return string AJAX Response Text without debug text

  13   */
  14  function ajax_debug_clear( result )
  15  {
  16      // Delete a verifying text from result

  17      var check_exp = /<!-- Ajax response end -->/;
  18      result = result.replace( check_exp, '' );
  19  
  20      // Delete debug info

  21      result = result.replace( /(<div class="jslog">[\s\S]*)/i, '' );
  22  
  23      return jQuery.trim( result );
  24  }
  25  
  26  /**

  27   * Check ajax response data for correct format

  28   *

  29   * @param string AJAX Response text

  30   * @return boolean TRUE if response data has a correct format

  31   */
  32  function ajax_response_is_correct( result )
  33  {
  34      var check_exp = /<!-- Ajax response end -->/;
  35      var is_correct = result.match( check_exp );
  36  
  37      if( !is_correct )
  38      {    // Response data is incorrect
  39          return false;
  40      }
  41  
  42      // Delete a debug data from result

  43      result = ajax_debug_clear( result );
  44      
  45      // TRUE if result is not empty

  46      return result != '';
  47  }

title

Description

title

Description

title

Description

title

title

Body