I'm getting data via AJAX. When I get response, I want to put variables from current symbol table (which I get from extract($this->args)) to ajax-response. The ajax.php is something like:
<div class="modal fade <?php echo $class; ?>" id="<?php echo $id; ?>" tabindex="-1" role="dialog" aria-hidden="true"></div>
So the variables in ajax.php should be replaced by variables from current symbol table. This is my code:
private function generate_js( $call_selector, $modal_id ) {
ob_start();
extract($this->args); ?>
$("<?php echo $call_selector; ?>").click(function(e){
e.preventDefault();
if (!jQuery('#<?php echo $modal_id; ?>').length) {
jQuery.when(
jQuery.ajax({
url: 'ajax.php',
success: function(response) {
jQuery(response).appendTo(jQuery('body'));
}
})).done( function (){
jQuery('#<?php echo $modal_id; ?>').modal('show');
});
}
});
But unfortunately I get only:
<div class="modal fade " id tabindex="-1" role="dialog" aria-hidden="true"></div>
Any solutions? Thanks! P.S. Vars in current symbol table do exist.