一般情况下,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. L164

    “TAKE ONLY memories, leave only footprints” is more than a hiking motto at the Sagarmatha National P ...

  2. LINUX系统中高级网络服务:Bond、Team和网桥

    Bond 一.什么是Bond bond就是将两块网卡虚拟链接成一块网卡的技术.通过bond技术让多块网卡看起来是一个单独的以太网接口设备并具有相同的ip地址. 二.为什么要配置Bond 通过网卡绑定技 ...

  3. vs2008配置winddk

    Vs2008配置winddk 1.  安装winddk,我安装在了c盘下:   2. 电脑->属性->环境配置里 系统变量里加入 DDKBASE,其值是   3. path变量里增加 ;C ...

  4. Hibernate Validator参数校验

    日常开发中经常会遇到需要参数校验的情况,比如某个字段不能为空.长度不能超过5等都属于参数校验的范围.对于简单的参数校验通过写几个if-else判断语句就搞定,但是对于复杂的多个参数校验的情况,就不是那 ...

  5. Android 你可能忽略的提高敲代码效率的方式

    Android 你可能忽略的提高敲代码效率的方式

  6. js 要写严格模式

    js 为了能在移动端通用,要写严格模式: 这里多了个逗号,在pc上浏览器可以通过,但是在手机端就不能.

  7. 原 the app referencesnon-public selectors in payload

    摘要 当我们上传验证的时候,出现了the app referencesnon-public selectors in payload/项目名.app/项目:字符 的警告的解决办法 当我们上传验证的时候 ...

  8. SQL Server 批量插入数据

    请看代码: 创建表值参数类型: 请看代码:

  9. Makefile中怎么使用Shell if判断

    /********************************************************************* * Makefile中怎么使用Shell if判断 * 说 ...

  10. 阿里面试题,N个士兵的通话问题

    战场上不同的位置有N个战士(n>4),每个战士知道当前的一些战况,现在需要这n个战士通过通话交流,互相传达自己知道的战况信息,每次通话,可以让通话的双方知道对方的所有情报,设计算法,使用最少的通 ...