title: How to introduce JavaScript alert window inside PHP code
body: <p>I need to introduce JavaScript alert function <code>show_alert()</code> inside PHP code. How this can be done?</p>
  
  <pre><code>script type="text/javascript"&gt;
          function show_alert() {
              var msg = "No solution found.";
              alert(msg);
          }
  &lt;/script&gt;
  &lt;?php
  //...
      $outputs = -1;
      if ($outputs == -1) {
          echo '&lt;script type="text/javascript"&gt; show_alert(); &lt;/script&gt;';
      } else {
          ?&gt;
          &lt;table width="100%"&gt;
              &lt;tr&gt;
                  &lt;td width="100%"&gt; 
                      &lt;div class="scrollbar" id="chart"&gt;
                          &lt;img src="ganttchart.php"&gt;
                      &lt;/div&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
          &lt;/table&gt;
      &lt;?php
      }
  ?&gt;
  </code></pre>