Home >Backend Development >PHP Tutorial >初学。请问 直接调用 file_get_contents()可以获得返回值。而通过ajax 调用含有 file_get_contents 后台 就没有任何响应呢

初学。请问 直接调用 file_get_contents()可以获得返回值。而通过ajax 调用含有 file_get_contents 后台 就没有任何响应呢

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-23 13:36:231085browse

初学。请问 直接调用 file_get_contents()可以获得返回值。而通过ajax 调用含有 file_get_contents 后台 就没有任何响应呢


回复讨论(解决方案)

目标 url ?
你的代码?

不是跨域了,即使你写错了

控制台看下有没有报错

目标 url ?
你的代码?

不是跨域了,即使你写错了


谢谢。是跨域了。想ajax发送请求给自己的网站后台  自己网站后台在真正发送该请求。但不知道要怎么改img=http://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/003/monkey/2.gif][/img]
Statement:
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
Previous article:php +ajax +sql 实现分页Next article:php 观察者模式