<!DOCTYPE html>
<html>
<body>
<div>
<button onclick = "one()">start!</button>
</div>
<script>
<?php
function one() {
if (!file_exists("error_handling.txt")){
die("The File Does Not Exist!");
}else{
$file = fopen("error_handling.txt","r");
};
}
?>
</script>
<p id = "demo">???</p>
</body>
</html>
是因为JS内不能embedPHP吗?但是好像也不是这个原因。麻烦大家帮忙看看了