$(document).ready(
function
(){
<?php $f=
"'name'"
?>
var
t=<?php echo $f?>;
alert(t)
})
或
<script language=
"javascript"
>
var
t=<?php echo
'"sd"'
?>;
alert(t)
</script>
来源:http://www.cnblogs.com/breakdown/archive/2012/04/23/2466469.html