Why doesn't my code work?
function _(x){
return document.getElementById(x);
}
function friends(){
_("right").innerHTML = '<?php include_once "friendlist.php";?>';
}
Result:
<!--?php include_once "friendlist.php";?-->
How can I fix it?
you have to do like this
$(document).ready(function(){
$("#your_id").click(function(){
$("#your_div").load('friendlist.php');
});
});
use below code it will work
<div id="right">
<script>
document.write('<?php echo include_once "include.php";?>');
</script>
</div>
or i test below code also it will work
<body>
<div id ="right" >
</div>
</body>
<script>
function friends(){
var x=document.getElementById("right");
x.innerHTML = '<?php include_once "include.php";?>';
}
friends();
</script>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With