php与js相互调用

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>

猜你喜欢

转载自www.cnblogs.com/hnqyliu/p/10350428.html
今日推荐