在对应js语句前加上: echo "<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>"; 注意里面的charset编码需要填写你网页对应的编码。