时间:2021-07-01 10:21:17 帮助过:27人阅读
示例
php<?php
$classState="";
if($state==0){
$classState="已下课";
}
else{
$classState="正在上课";
}
echo "<script type='text/javascript'>
function getState(){
var cs = ".$state.";
return cs;
}
</script>";
?>这样在页面的其他地方,就可以直接引用php中输出的js方法了.
以上就是php中输出js语句 - Blue Moon 的详细内容,更多请关注Gxl网其它相关文章!