一、若是請求的url是jsp頁面,則須要添加代碼:Response.AddHeader("Access-Control-Allow-Origin", "*");
html
二、若是請求的url是PHP頁面,則須要添加代碼:header("Access-Control-Allow-Origin: *");jsp
三、若是請求的url是靜態的html頁面,則須要添加meta標籤代碼:<meta http-equiv="Access-Control-Allow-Origin" content="*" />ui