I was trying to make an ajax call and show an html part inside a div class. For that i used the following way.
$.ajax({
    type: "get",
    url: "{{url('searchByCheckbox')}}",
    dataType: 'html',
      success: function(html)
        {
           $(".infinite-scroll").html(html)
        }   
});
But the problem is there is a script inside that html part which i wanted to load when i make first ajax call it's not loaded but for the second one it's loaded the script. suppose the html response like this :
<script>
  alert()
</script>
// html
How do i make it work? I put the script above the html page which i'm getting as response.
(those who are marking the Question as duplicate should read at least what i want and what they wanted )
 
    