How to apply js and css to ajax loaded content?
Is there any issue with above code?


Yes, you're using the D7 approach. In D8 it is different. You need to create a libraries.yml file where you will define your CSS and JS files. 

See:

Adding stylesheets (CSS) and JavaScript (JS) to a Drupal 8 module 

Adding stylesheets (CSS) and JavaScript (JS) to a Drupal 8 theme

Once you have a library you can attach it like this:

  '#attached' =&gt; array(
    'library' =&gt; array(
      'your_theme/library_name',
    ),