2019-2-3
php与js相互调用
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<script type="text/javascript">
function test() {
var t1=3;
t1 = t1+2;
alert(t1);
return t1;
}
</script>
<?php
$name=‘Jet li‘;
// echo "<script type=‘text/javascript‘>test();</script>";
?>
<script>
document.write("welcome!"+"<?php echo $name ?>");
alert("welcome!"+"<?php echo $name ?>");
</script>
原文地址:https://www.cnblogs.com/hnqyliu/p/10350428.html
时间: 2024-10-01 00:31:27