triggering a jquery's ready() from another webpage's jquery's ready()

84 views Asked by At

I could not get the child's ajax result in parent page..the child's component does not get displayed in parent page.My guess is that the child's ready function is not getting triggered.I am not sure of why?any help would be much appreciated. Sample call:

 //parent page contains this function
  $(document).ready(function()
  {
  $('#a').click(function()
  {
  $.ajax({
            type: "GET",
            url : "child_ajax.php",                     
            data:{},
            success : function(result){
                window.setTimeout(function(){
                    $('#result_div').html(result);
                }, 100);
            }
  });
 });
 });
 <div id="result_div"></div>
 <div id="a">click</div>

//child_ajax.php
  $(document).ready(function()
  {
   alert('welcome');
    $.ajax({
    type: "GET",
    url : "child2_ajax.php",                    
    data:{},
    success : function(result){
    window.setTimeout(function(){
    $('#result_div_child').html(result);
    }, 100);
    }
  });
      });
  <div id="result_div_child"><div>
0

There are 0 answers