AJAX没有加载其他js和css样式

I wrote a short AJAX code which is getting Facebook contents from a PHP file (in the PHP file I have declared class="gallery-img-link" as <a> and class="img-responsive img-thumbnail" as <img>).

I have the gallery-img-link on the bottom of site as jQuery script, the problem is when I add those classes by hand its working fine, but when I try to load those by a AJAX get request it seems to doesn't work.

Should I use it in a document.ready function?

I have tried live as well, but that didn't helped at all.

                          $(document).ready(function(){
                            $(\'#loading-image\').show();
                              $.ajax({
                                method:\'get\',
                                url:\'ajax.php\',
                                success:function(data){
                                  $("#facebook").html(data);
                                    },
                                complete: function(){
                                 $(\'#loading-image\').hide();
                                }
                              });
                          });

For all JavaScript DOM manipulations you Need the DOM to be fully loaded.

Without having your PHP and other Code around I can just correct your JS:

$(document).ready(function(){
      $('#loading-image').show();
      $.ajax({
           method: get ,
           url: ajax.php ,
           success: function(data){
                $("#facebook").html(data);
           },
           complete: function(){
                $('#loading-image').hide();
           }
       });  
});

UPDATE:

Go Into the f12 Developer Tools in your Browser, and go to the Network Tab, then have a llok o all loaded Files, on should be ajax.php. Have a look what the File of that COntent is

Basicly the problem was that the content has been loaded but the "photo java script file" wasnt waiting to get the page loaded, so this function couldnt work at all. Becasue those AJAX loaded after "reading JS function".