一般情况下,laravel在方法里可以向前端返回数组格式 return [],

框架可以自动将数组转成JSON字符串返回,但浏览器会报MIME类型警告,

如是做APP接口可以忽视该警告;

但在前端ajax异步请求时最好把返回的数组手动转化成json字符串返回,

也是就json_encode([]),这样就不会出现Resource interpreted as Document but transferred with MIME type application/json警告

Resource interpreted as Document but transferred with MIME type application/json laravel异常请求返回警告的更多相关文章

  1. 解决IE浏览器中出现“Resource interpreted as Document but transferred with MIME type application/json”问题

    在上传图片时,使用ajax提交,返回的数据格式为json.在测试时发现IE浏览器中,上传图片后,没有显示图片,而是弹出一个提示:是否保存UploadImg.json文件:而在其他浏览器中正常. 在Ch ...

  2. Resource interpreted as Document but transferred with MIME type application/json

    转自:https://blog.csdn.net/just_lover/article/details/81207472 我在修改并保存后,界面返回提示“undifine”,实际我是看到有返回提示的. ...

  3. 移动端,点击a标签链接的pdf报错 Resource interpreted as Document but transferred with MIME type application/pdf

    源码: <a href="11.pdf" class="actcont_a fl report_a" style="display: block ...

  4. odoo 错误 Resource interpreted as Stylesheet but transferred with MIME type application/x-css:

    odoo8   页面内容显示一半,  web 控制台显示错误  Resource interpreted as Stylesheet but transferred with MIME type ap ...

  5. Django 导入css文件,样式不起作用。Resource interpreted as Stylesheet but transferred with MIME type application/x-css

    笔者今天在模板中加载css文件时,发现 css样式能够下载再来却无法起作用,而且,图片.js都能够正常使用. 并且 浏览器提示: Resource interpreted as Stylesheet ...

  6. Chrome: Resource interpreted as Font but transferred with MIME type font/x-woff

    最近,项目中加入了Bootstrap进行界面优化,但是,项目加载运行之后,控制台总是提示以下错误信息: GET http://localhost:8080/.../fonts/fontawesome- ...

  7. Resource interpreted as Script but transferred with MIME type text/plain:

    我用script做ajax跨域,请求返回的是个文本字符串,chrome提示:Resource interpreted as Script but transferred with MIME type ...

  8. Chrome 报 Resource interpreted as Script but transferred with MIME type text/plain 警告的解决办法

    http://www.2cto.com/os/201312/262437.html 安装了VS2012之后,chrome在加载页面的时候会报 Resource interpreted as Scrip ...

  9. Resource interpreted as Stylesheet but transferred with MIME type text/plain

    今天碰到了Resource interpreted as Stylesheet but transferred with MIME type text/plain 这个错误. 原因:在web中配置了f ...

随机推荐

  1. qml 带时钟效果

    qt 自带源码样例:在样例中输入clock,找到名叫Qt Quick Demo Clocks. 这个样例写的不错,还是带时差的.不过我们其实不需要这么复杂的功能. timer启动这个就不用说了: Ti ...

  2. 【LeetCode 231_整数_位运算】Power of Two

    bool isPowerOfTwo(int n) { && !(n & (n - )); }

  3. Redis数据库的学习及与python的交互

    1. 数据库简介: 当前主要使用两种类型的数据库:关系型数据库(RDBMS).非关系型数据库(NoSQL); (1). 关系型数据库RDBMS: 是建立在关系模型基础上的数据库,借助于集合代数等数学概 ...

  4. PostgreSQL 系统参数调整及并行设置(转)

    转自:https://yq.aliyun.com/teams/5 OS 准备 # yum -y install coreutils glib2 lrzsz sysstat e4fsprogs xfsp ...

  5. iOS实现程序长时间未操作退出

    大部分银行客户端都有这样的需求,在用户一定时间内未操作,即认定为token失效,但未操作是任何判定的呢?我的想法是用户未进行任何touch时间,原理就是监听runloop事件.我们需要进行的操作是创建 ...

  6. No form of payment has been added yet.

    You may select a form of payment after your account balance reaches $10.00. Learn more 显然是说达到10美元以后才 ...

  7. iOS 11 Xcode 开发包SDK

    一不小心,手机又升级了,哎

  8. Win10安装Ubuntu16.04 双系统

    Tips: 双系统Ubuntu可以使用机器的GPU硬件,虚拟机不可以 压缩卷留的空间尽量大一点,不要相信50G够用 选UEFI,并关闭 Secure Boot,不要选 Legacy 选UEFI,就要在 ...

  9. Ubuntu网络代理问题

    问题描述 新开机的电脑,不开lantern就上不了网.很气. 解决过程 首先当然是寻求解决方案了.未果 然后就是妥协,每次先开一次lantern.(其实也不是很麻烦是吧,哎,是的是的) 今天早晨友人来 ...

  10. HihoCoder - 1496:寻找最大值(高维前缀和||手动求子集)

    描述 给定N个数A1, A2, A3, ... AN,小Ho想从中找到两个数Ai和Aj(i ≠ j)使得乘积Ai × Aj × (Ai AND Aj)最大.其中AND是按位与操作. 小Ho当然知道怎么 ...