duanliao6789 2015-05-31 10:52
浏览 35

php < - > ajax跨域错误

I am using localhost devlopment.

Request headers:

Host                localhost
If-Modified-Since   Sun, 31 May 2015 10:30:44 GMT
If-None-Match       "2486-5175e33a3f259"
Referer             http://localhost/front-page1/front-page/homepage.html
User-Agent          Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0)  
                    Gecko/20100101 Firefox/38.0

Whatever php page i access from ajax, it says

 SyntaxError: Unexpected end of input
at Object.parse (native)
at n.parseJSON (http://localhost/front-page1/front-page/lib/jquery-2.1.3.min.js:4:5309)
at uc (http://localhost/front-page1/front-page/lib/jquery-2.1.3.min.js:4:7333)
at x (http://localhost/front-page1/front-page/lib/jquery-2.1.3.min.js:4:10747)
at XMLHttpRequest.n.ajaxTransport.k.cors.a.crossDomain.send.b 
(http://localhost/front-page1/front-page/lib/jquery-2.1.3.min.js:4:14577)

I don't understand how it became cross domain. And don't even understand the error. Please help me to solve this issue.

I just formatted my system and used sql scripts which are exported from my old system and all other codes are same.

Please let me know if other data required.

ERROR;

$connection = mysqli_connect(DB_SERVER,DB_USERNAME,DB_PASSWORD,DB_DATABASE) or die('{"message":"Database Error","status":"-1"}');

But this die is not getting executed.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 改算法,照着压缩包里边,参考其他代码封装的格式 写到main函数里
    • ¥15 用windows做服务的同志有吗
    • ¥60 求一个简单的网页(标签-安全|关键词-上传)
    • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法
    • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
    • ¥100 为什么这个恒流源电路不能恒流?
    • ¥15 有偿求跨组件数据流路径图
    • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
    • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
    • ¥15 一直显示正在等待HID—ISP