how to get a php-builded HTML string, in a Javascript variable, from AJAX request ?

how to get a php-builded HTML string, in a Javascript variable, from AJAX request ?

Hello,

What I need to get is something like this :

  1. <script>var my_var = "<p>Hello</p>";
But I need this content to be builded in PHP, from an external file.

So I tried this :

  1. var my_var =     $.ajax({
                                    type: "POST",
                                    url: "<?php echo $config["root_url"]; ?>/www/ajax_queries.php",
                                    data: "action=build_form_for_inscription_CN&event_id=" + event_id,
                                }).responseText;



In my ajax_queries.php file, I have :

  1. $str = "<p>test</p><strong>retest</strong>";
  2. echo $str;
But I don't receive it in my my_var JS variable.

How can I do ?