<script>
function aaa()
{
var abc="ffff";
<? $a="select * from tb where a='+abc+'"?>
alert(<?echo($a)?>);
}
</script>
function aaa()
{
var abc="ffff";
<? $a="select * from tb where a='+abc+'"?>
alert(<?echo($a)?>);
}
</script>
如果是js 引用php 还行。
但php 引用js 不可能在一个页面里作到。
因为php 是服务器先执行的,然后才交给client 处理js .
除非你在js 处理完后重新location.href="abc.php?abc="+abc
这样传递.