Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
191
rated 0 times [  198] [ 7]  / answers: 1 / hits: 40264  / 9 Years ago, sat, april 4, 2015, 12:00:00

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?


More From » php

 Answers
54

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>

[#67202] Wednesday, April 1, 2015, 9 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
amberlykaliac

Total Points: 415
Total Questions: 100
Total Answers: 85

Location: Wallis and Futuna
Member since Tue, Mar 30, 2021
3 Years ago
;