Can’t change div-Tag after load()-response

Can’t change div-Tag after load()-response

Hello alltogether

I have a problem with my html-JQuery-Ajax project.

I have an empty div-Container.

  1. <div class="form-group" id="UserDiv"> </div>

In this div-Container with the id=“UserDiv” i will load a select field of users, which is generated by a php script.
This is the jquery-Function of the call:

  1. function loadDiv(){
  2.       $("#UserDiv").load("../includes/UserProwalus.inc.php",       function(response, status, xhr) {
  3.  if(status=="success"){
  4.      alert(response);
  5.      $("#UserDiv").html(response);
  6.  }
  7. });
  8. }

The php script looks so. Also the database query works very well. This is a self-generated answer(for test purposes) as the normal database query actually looks like:

  1. $content="";
    $content.="<select class='selectpicker show-tick show-menu-arrow' 
    id='UserBlock' name='UserBlock' data-width='75%' data-size='8'
    title='PrOWaLuS+ - User'>
    "; $content.="<option value='15|31'>Mr Green</option>"; $content.="</select>"; echo $content;

The problem is, that the script works absolute fine, because the correct result is displayed in the alert-window.

But the command $("#UserDiv").html(response); does not work and i don’t know why?

Even if i let return a simple response from the php-script, the response isn’t displayed in the div-tag.

I need your help.
Thanks a lot.