如果可能的话,在javascript中运行php标签?

Mah*_*ine -1 javascript php

<script type="text/javascript">
           function mehdi()
           {
               alert('salam');
              <?php 
               echo'hi';
               ?>

             }

</script>
this is html:
      <input type="button" name ="submit" value="submit" onclick= "mehdi()">
Run Code Online (Sandbox Code Playgroud)

如果ehco将在此代码中执行?如果没有,我怎么运行它?

Dec*_*ook 7

PHP将在发送到浏览器之前在您的服务器上运行,因此浏览器将收到该页面:

<script type="text/javascript">
function mehdi()
       {
          alert('salam');
          hi
        }
</script>
Run Code Online (Sandbox Code Playgroud)