title: Is there a other, better way to call this js, which is coming from ajax?
body: <p>I would like to ask about eval() function, I have working code where I use this function, but I saw that is not good practice to be used. so I was wondering is there any other way to do that: I have response from ajax, this response is a web page, which contains a bit of js code inside. So when I parse this page in a div jquery removes all js, that's why I have id attribute of my  which is inside that page so i can access that code and than I execute with eval. I'll put some code for example: </p>
  
  <pre><code>success:function(data){
   $('title').html($(data).filter('title').html()); 
   var js = $(data).filter('#script').html(); 
   var page = $(data).filter('#content').html(); 
   $('#content').html(page); 
   eval(js);
  }
  </code></pre>
  
  <p>So actually my question is there a other, better way to call this js, which is coming from ajax?</p>