php服务端处理ajax跨域请求 //解决跨域--析构方法 protected function _initialize() { header('content-type:text/html;charset=utf-8'); header('Access-Control-Allow-Origin: *'); header("Access-Control-Allow-Headers: Origin, X-Req
          //解决跨域--析构方法
    protected function _initialize()
    {
        header('content-type:text/html;charset=utf-8');
        header('Access-Control-Allow-Origin: *');
        header("Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept");
        header('Access-Control-Allow-Methods: GET, POST, PUT');
        ksort($_POST);
        ksort($_GET);
    }
        
        