title: not able to run jquery - ajax with php
body: <p><strong>Welcome.php</strong></p>
  
  <pre><code>&lt;script src="https://code.jquery.com/jquery-1.11.3.min.js"&gt;&lt;/script&gt;
  
  &lt;script type="text/javascript"&gt;
    $(document).ready(function() {
      $("#role").on("change", function() {
        alert($("#role").val());
        var role_name = $("#role").val();
  
        $.ajax({
          type: "post",
          url: "createuser.php",
          data: "role_name=" + role_name,
          success: function(data) {
            $("#info").html(data);
          }
        });
      });
    });
  &lt;/script&gt;
  </code></pre>
  
  <p>I'm trying to run jquery - ajax in php file but the code is not working secondly only first alert() function is working. When <code>alert()</code> is used within <code>$ajax()</code> function both the <code>alert()</code> stops working</p>