title: Is there any js function to run a script after ajax load of content?
body: <p>There are more than 2 questions about "How to run a js after Ajax load of content". They all suggest to run JS after Ajax load completed. I know how to handle that.</p>
  
  <p>Suppose more than 40 pages load a page <code>my-Page.php</code> via Ajax. Is there any JS function like <code>$(document).ready</code> to handle running the script after Ajax load of content?</p>
  
  <p>Please note that editing more than 40 files is not rational.</p>
  
  <p>A little bit more about my problem:</p>
  
  <p>I am customizing sugar crm to use jquery ui date picker instead of its simple JS calendar. calling <code>$('#inp').datepicker()</code> in a Ajax call fails, because there is no <code>$(#inp)</code> object available.</p>
  
  <blockquote>
    <p>works</p>
  </blockquote>
  
  <pre><code>Calendar.setup ({ldelim}
           inputField : "{{$idname}}",
           ifFormat : "{$CALENDAR_FORMAT}",
           daFormat : "{$CALENDAR_FORMAT}",
           button : "{{$idname}}_trigger",
           singleClick : true,
           dateStr : "{$date_value}",
           step : 1,
           weekNumbers:false  {rdelim}    );
  </code></pre>
  
  <hr>
  
  <blockquote>
    <p><code>doesn't work</code> <BR></p>
  </blockquote>
  
  <pre><code> jQuery(function() {ldelim}
                        jQuery('#{{$idname}}_hpm').datepicker({ldelim}
                            showOn: 'button',
                            buttonImage: 'include/jdp/styles/images/calendar.png',
                            buttonImageOnly: true,
                            changeMonth: true,
                            changeYear: true,
                            dateFormat: 'yy/mm/dd'
                        {rdelim});
                    {rdelim});
  </code></pre>
  
  <p>I wonder how it's basic <code>Calendar.setup()</code> works, but my script.</p>