2

I am new to stackoverflow. I have this code

if(screen.width<500){
 document.write("<?php echo 'Hello Mobile'; ?>");
}else{

 document.write("<?php echo 'Hello PC'; ?>");
}

it shows only "Hello PC".

but when I run this on my web browser, It loads the both php files.

if(screen.width<500){
 document.write("<?php include('a.php'); ?>");
}else{

 document.write("<?php include('b.php'); ?>");
}

Why, what's the wrong? Please help me to use "include" with this javascript code Thanks

ChethiyaKD
  • 726
  • 2
  • 7
  • 13

0 Answers0