Namespace declaration statement has to be the very first statement in the script 这个错误因为在代码文件里面有bom的存在,把bom去掉之后就可以了 可以用notepad++另存一个无bom的就可以了