Javascript running once from ajax response
<p>I am opening cart checkout page data when clicked on checkoutbutton, checkout response retrieved with html and javascript code and javascript code run once only. response code cannot run again if I open checkout page again without refresh or just click on checkout button.
Note: There is no any syntax error in ajax response's script</p>

<p>sorry for my bad English</p>

<p>function where I am retrieving the data</p>

<pre><code>function createnewPage_loadURL(createpageparam){
    var loadpageurl = '';
    if(typeof createpageparam.loadpageurl!=='undefined'){
        loadpageurl = domainurl+'index.php?route='+createpageparam.loadpageurl+'&amp;therandparam='+unique_chrs('',10)
    }
    $.ajax({
        type:"GET",
        url:loadpageurl
    }).success(function(pageloadresponse){
        $(target_sel_fill_loaddata).html(pageloadresponse);
    });
}
</code></pre>

<p>Response Example</p>

<pre><code>&lt;script type="text/javascript"&gt;
    alert('THIS ALERT SHOWING ONCE ONLY');

    $(document).on('change', 'input[name=\'account\']', function() {
        if ($('#collapse-payment-address').parent().find('.panel-heading .panel-title &gt; *').is('a')) {
            if (this.value == 'register') {
                $('#collapse-payment-address').parent().find('.panel-heading .panel-title').html('&lt;a href="#collapse-payment-address" data-toggle="collapse" data-parent="#accordion" class="accordion-toggle"&gt;&lt;?php echo $text_checkout_account; ?&gt; &lt;i class="fa fa-caret-down"&gt;&lt;/i&gt;&lt;/a&gt;');
            } else {
                $('#collapse-payment-address').parent().find('.panel-heading .panel-title').html('&lt;a href="#collapse-payment-address" data-toggle="collapse" data-parent="#accordion" class="accordion-toggle"&gt;&lt;?php echo $text_checkout_payment_address; ?&gt; &lt;i class="fa fa-caret-down"&gt;&lt;/i&gt;&lt;/a&gt;');
            }
        } else {
            if (this.value == 'register') {
                $('#collapse-payment-address').parent().find('.panel-heading .panel-title').html('&lt;?php echo $text_checkout_account; ?&gt;');
            } else {
                $('#collapse-payment-address').parent().find('.panel-heading .panel-title').html('&lt;?php echo $text_checkout_payment_address; ?&gt;');
            }
        }
    });
&lt;?php  if (!$logged) { ?&gt;

            $.ajax({
                url: domainurl+'index.php?route=mobile/checkout/login',
                dataType: 'html',
                success: function(html) {
                    $('#collapse-checkout-option .panel-body').html(html);

                    $('#collapse-checkout-option').parent().find('.panel-heading .panel-title').html('&lt;a href="#collapse-checkout-option" data-toggle="collapse" data-parent="#accordion" class="accordion-toggle"&gt;&lt;?php echo $text_checkout_option; ?&gt; &lt;i class="fa fa-caret-down"&gt;&lt;/i&gt;&lt;/a&gt;');

                    $('a[href=\'#collapse-checkout-option\']').trigger('click');
                },
                error: function(xhr, ajaxOptions, thrownError) {
                    alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
                }
            });

    &lt;?php } else { ?&gt;
            alert('mobile/checkout/payment_address__LINE-121');
            $.ajax({
                url: domainurl+'index.php?route=mobile/checkout/payment_address',
                dataType: 'html',
                success: function(html) {
                    $('#collapse-payment-address .panel-body').html(html);

                    $('#collapse-payment-address').parent().find('.panel-heading .panel-title').html('&lt;a href="#collapse-payment-address" data-toggle="collapse" data-parent="#accordion" class="accordion-toggle"&gt;&lt;?php echo $text_checkout_payment_address; ?&gt; &lt;i class="fa fa-caret-down"&gt;&lt;/i&gt;&lt;/a&gt;');

                    $('a[href=\'#collapse-payment-address\']').trigger('click');
                },
                error: function(xhr, ajaxOptions, thrownError) {
                    alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
                }
            });

    &lt;?php } ?&gt;
&lt;/script&gt;
</code></pre>