一般情况下,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. tooltip提示框组件

    Tooltip 提示框组件 可独立于其他组件通过$.fn.tooltip.defaults重写默认的defaults.当用户移动鼠标指针在某个元素上时,出现提示信息窗口来显示额外信息.提示内容可以包含 ...

  2. 疑问:@Autowired的作用?[待解答]

    有下面一个Spring的工程,工程结构如下: 代码如下: applicationContext.xml: <?xml version="1.0" encoding=" ...

  3. LINUX系统下的shell命令---diff、cut、sort、uniq等

    1)diff:比较两个文件或目录的不同    -b      不检查空格字符的不同    -B      不检查空白行    -c      显示全部内容,并标出不同之处    -i      不检查 ...

  4. live555 中的socket的任务调度分析

    1.添加一个socket任务 envir().taskScheduler().setBackgroundHandling(socketNum, SOCKET_WRITABLE|SOCKET_EXCEP ...

  5. SpringMVC札集(05)——SpringMVC参数回显

    自定义View系列教程00–推翻自己和过往,重学自定义View 自定义View系列教程01–常用工具介绍 自定义View系列教程02–onMeasure源码详尽分析 自定义View系列教程03–onL ...

  6. Java API操作ZK node

    创建会话 建立简单连接 /** * 测试创建Zk会话 * Created by liuhuichao on 2017/7/25. */ public class ZooKeeper_Construct ...

  7. sersync2 文件的实时同步备份

    |——需求: 监控192.168.9.5[主]  下的 /data/vmeipai 目录  --> 同步到 192.168.12.8 [备] 下的 /data/vmeipai 目录 |——网络拓 ...

  8. ios 控制器的生命周期

    #pragma mark - 控制器生命周期 // 视图将要出现 - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:anima ...

  9. 线性回归 Linear regression(4) 局部加权回归

    这篇文章将介绍过拟合和欠拟合的概念,并且介绍局部加权回归算法. 过拟合和欠拟合 之前在线性回归中,我们总是将单独的x作为我们的特征,但其实我们可以考虑将,甚至x的更高次作为我们的特征,那么我们通过线性 ...

  10. 快速学习MD5的方法

    MD5加密的Java实现 在各种应用系统中,如果需要设置账户,那么就会涉及到存储用户账户信息的问题,为了保证所存储账户信息的安全,通常会采用MD5加密的方式来,进行存储.首先,简单得介绍一下,什么是M ...