<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将在此代码中执行?如果没有,我怎么运行它?
PHP将在发送到浏览器之前在您的服务器上运行,因此浏览器将收到该页面:
<script type="text/javascript">
function mehdi()
{
alert('salam');
hi
}
</script>
Run Code Online (Sandbox Code Playgroud)