title: How to add php content or variable inside javascript alert box?! javascript, php, alertbox
body: <p>How can i add php content or php variable inside Java-script alert box?!
  I tried to make it work few ways but it is only popping up a blank box rather than the contents of php variable.</p>
  
  <p>Here is the code: </p>
  
  <pre><code>&lt;script language="javascript"&gt;
      $(document).ready(function() {
          $("#a").blur(function() {           
              &lt;?php $b = $_POST['a'];
  
              if(isset($_POST['update'])) {
              mysql_query("UPDATE tbl_travel set fld_a='".$_POST[$b]."' where fld_id = '".$_POST["id"]."' ") or die(mysql_error());
              } ?&gt;
  
                  alert (&lt;?php $b ?&gt;);
             });
      });
  &lt;/script&gt; 
  </code></pre>
  
  <p>Thank You for your Help :)</p>