Q:

How execute javascript at response from Ajax?

At my Ajax response there is two variable: js, html.
The js variable contents Javascript in tag script: //Some code
And html contents HTML template.
How I can execute js code for html template from the successful response Ajax?
I tried this solution:
$('head').append(response.js); // not works

The full Ajax request:
getFormShare: function(type){
        var posting = $.post('/share/getFormShare', { type : type } );

        posting.done(function( response ) {
            response = $.parseJSON(response);

            $("head").append(response.js);
            $('.ShareBlock #block').html(response.html).show();

            initFileUpload(config);
            initEditor();

        });
    }

The PHP side:
$js = $this->listdata->WrapperJavaScript($specialization, array('name_field' => 'type[]', 'tab' =>'tab', 'div_element' => '.specMain', 'label' => 'Category', 'autosearch' => 'true'));

$html = $this->load->view('social/forms/video', $this->data, true);
echo json_encode(array('html' => $html, 'js' => $js)); die();

A:

You can use .getScript() and run your code after it loads:
 $.getScript("my_lovely_script.js", function(){

    alert("Script loaded and executed.");
    // here you can use anything you defined in the loaded script

 });

You can see a better explanation here: How do I include a JavaScript file in another JavaScript file?

Edit:
Since you're returning actual javascript and would like to execute it, you can simply do this in your ajax response:
 $.get(url,function(data){ $("body").append(data); });

Edit:
And with help from Mike's answer, you can use eval() to run the script if you don't have script tags in your response.  His answer gives more info on this.

