为什么我的代码不工作?JavaScript innerHTML include php
function _(x){
return document.getElementById(x);
}
function friends(){
_("right").innerHTML = '<?php include_once "friendlist.php";?>';
}
结果:
<!--?php include_once "friendlist.php";?-->
我怎样才能解决呢?
你想要什么? – 2015-04-04 07:12:15
它应该点击加载php文件转换为div的朋友 – User 2015-04-04 07:13:37
使用_(“right”)。innerHTML ='<?php echo include_once“friendlist.php”;?>'; – Saty 2015-04-04 07:16:04