WordPress.org

Plugin Directory

Changeset 342299


Ignore:
Timestamp:
02/08/11 09:02:44 (3 years ago)
Author:
tott
Message:

make sure to execute ajax calls after load event fired

File:
1 edited

Legend:

Unmodified
Added
Removed
  • remote-api/trunk/client.php

    r339479 r342299  
    8585<script type="text/javascript"> 
    8686jQuery(function($) { 
    87     $.getJSON( \'' . $request_url . '\', function( data ) { 
    88         status = data.response.status; 
    89         if ( status == "true" ) { 
    90             html_result = data.response.result.output; 
    91         } else { 
    92             html_result = "There was an error"; 
    93         } 
    94         $(\'#' . $this->get_call_param( 'ajax_result_id' ) . '\').replaceWith( html_result ); 
     87    $(window).load(function(){ 
     88        $.getJSON( \'' . $request_url . '\', function( data ) { 
     89            if ( data.response.status ) { 
     90                html_result = data.response.result.output; 
     91            } else { 
     92                html_result = "There was an error"; 
     93            } 
     94            $(\'#' . $this->get_call_param( 'ajax_result_id' ) . '\').replaceWith( html_result ); 
     95        }); 
    9596    }); 
    9697}); 
Note: See TracChangeset for help on using the changeset viewer.