EasyUI form ajax submit后,在IE下提示下载内容的解决办法
程序员文章站
2022-07-12 09:22:48
...
使用EasyUI form插件创建或编辑成功后返回json,在IE下总是提示下载内容,其他浏览器正常。
1.修改: contentType 为text/html
2.注解修改如下:
@RequestMapping(value = "/save", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
@ResponseBody
改为
@RequestMapping(value = "/save", method = RequestMethod.POST, produces = "text/htm;charset=UTF-8")
@ResponseBody
3.其他解决方法:
在IE9下,将json字符串用下面的格式返回给客户端
<body>
<pre>{"message":"保存成功","data":null,"success":true}</pre>
</body>
1.修改: contentType 为text/html
2.注解修改如下:
@RequestMapping(value = "/save", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
@ResponseBody
改为
@RequestMapping(value = "/save", method = RequestMethod.POST, produces = "text/htm;charset=UTF-8")
@ResponseBody
3.其他解决方法:
在IE9下,将json字符串用下面的格式返回给客户端
<body>
<pre>{"message":"保存成功","data":null,"success":true}</pre>
</body>
上一篇: rails
下一篇: ssh开发标准(自己陆续总结)