Home > Backend Development > PHP Tutorial > 一个ajax跨域问题

一个ajax跨域问题

WBOY
Release: 2016-06-20 12:26:21
Original
907 people have browsed it

提示是这个XMLHttpRequest cannot load http://localhost/admin/index.php?act=mb_special&op=special_item_add. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://127.0.0.1' is therefore not allowed access.

似乎本地环境不允许,假如非要在本地做,怎么解决此问题


回复讨论(解决方案)

楼主想要做的是什么??你这个请求涉及到跨域请求的东西,跨域直接这样请求是接收不到返回值的。

Header("Access-Control-Allow-Origin: * ");
Header("Access-Control-Allow-Methods: POST, GET");
跨域请求会出现一些不安全的问题

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template