title: alert inside ajax call
body: <p>I'm using an ajax call to call a php function where inside it I have an alert.
  But the alert not fire but return me the code of the javascript (seen inside console).
  How can I use an laert inside an ajax call?</p>
  
  <p>Please don't answer to use function success to check my data etc etc.. because I need alert inside the call please.</p>
  
  <p>This is my code simplified:</p>
  
  <pre><code>$('.form-booking').each(function(){
          $form = $(this);
          $.ajax({
              async: false,
              type: 'POST',
              url: someurl.php'',
              data: $form.serialize(),
              success: function (msg) {
                  console.log(msg);
              }
          });
      });
  </code></pre>
  
  <p>php part in <code>someurl.php</code></p>
  
  <pre><code>&lt;?php
  ....
  //some code
  ....
  if($some_condition){
            ?&gt;
            &lt;script&gt;
            if (confirm('Do you wanna go over?')) {
                //other code
            } else {
                window.location.href = 'otherurl.php';
            }
            &lt;/script&gt;
            &lt;?php
  }
  ?&gt;
  </code></pre>
  
  <p>This code does't show alert if the condition is true but I see inside console in tab <code>Net</code> the response and the code of the script in javascript</p>