My problem with the javascript file run through the AJAX call is

for example :

index.php 

```
$(function(){
$(".btn-ajax").click(function(){
$.getJSON('ajax.php',function(data){

jsInc(data['js'][0]['src']);

$("#response").html(data['html']);

});
});

function jsInc($src){
 var head = document.getElementsByTagName("head")[0];
            var script=document.createElement("script");
            script.type='text/javascript';
            script.src = $src;
            head.appendChild(script);
}   

```

ajax.php

```
$arr['js'][] = array('src'=>'js.js');
$arr['html'] = '<input type="button" class="btn" value="show message"/>';

echo json_encode($arr);

```

js.js

```
$(function(){

$(".btn").on('click',function(){
    alert("test !");
    });

});

```

but when execute ajax request and append input button to the index.php file this button click event not worked!

please help me

Thanks