一般情况下,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. C#运行批处理【转】

    /// <summary> /// C#运行bat文件 /// </summary> /// <param name="batPath">< ...

  2. C# 如何判断字符串中是否包含另一个字符串?

    如  字符串1(str1)为:“你好怎么解决呢!”    字符串2(str2)为:“你好” 如果str1里面包str2 则 Response.Write("成功");否则 Resp ...

  3. javaScript高程笔记--最佳实践

    1.可维护性 <1>什么是可维护的代码 (1)可理解性 (2)直观性 (3)可适应性 (4)可扩展性 (5)可调试性 <2>代码约定 (1)可读性---适当的进行注释[函数和方 ...

  4. 跟着小程学微服务-Mock自动化系统的原理及实现

    一.前言 在之前的文章 http://blog.csdn.net/u013970991/article/details/54862772 中已经介绍了"自动化Mock系统0.9版本" ...

  5. 对于KVO,你真的了解么?

      目录 关于面试 官方文档 核心代码 (Key-Value Observing) 进阶(手动创建KVO) 关于isa指针 参考文章链接 一.关于面试 面试官:谈一谈你对KVO的理解? A:添加响应者 ...

  6. MySQL中表的复制

    1.语法 create table 表名 select .. from 表名 where 条件; 2.示例 1.复制MOSHOU.sanguo表的全部记录和字段,sanguo2 create tabl ...

  7. sqlserver 执行脚本报内存溢出的处理方式

    用微软自带的sqlcmd工具,可以导入执行.以SQL Server 2008R2版本为例: 第一步:Win+R 键入:cmd 命令,开启命令行工具: 第二步:键入:cd C:\Program File ...

  8. [转]RC4加密已不再安全,破解效率极高

    原文链接:http://freebuf.com/news/72622.html 原文发表时间:2015.7.17 安全研究人员称,现在世界上近三分之一的HTTPS加密连接可被破解,并且效率极高.这种针 ...

  9. BZOJ4975: [Lydsy1708月赛]区间翻转( 博弈&逆序对)

    4975: [Lydsy1708月赛]区间翻转 Time Limit: 1 Sec  Memory Limit: 256 MBSubmit: 265  Solved: 140[Submit][Stat ...

  10. CDQ分治--用时间降维的美丽算法

    CDQ分治–用时间降维的美丽算法 CDQ分治,网上的阐述很多,太专业性的文字我就不赘述,这里指谈谈自己的感受 还是%一下CDQ大神的论文 CDQ分治的主要想法就是降维(比如三维问题降维到二维问题),并 ...