Skip to content

Commit

Permalink
fix: 优化ajax响应头的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
xiongwilee committed Mar 28, 2018
1 parent 5783db9 commit dc1ba4d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dist/static/js/base.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifest_version": 2,
"name": "show me 985/211",
"description": "告诉我985/211在哪里?!",
"version": "2.1",
"version": "2.2",
"homepage_url": "https://github.com/xiongwilee/show-me-985211",
"icons":
{
Expand Down
2 changes: 1 addition & 1 deletion static/js/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ showMe985211.base = (function() {
/*9.获取响应头Content-Type ---类型是字符串*/
var grc = xhr.getResponseHeader("Content-Type");
/*10.根据Content-Type类型来判断如何进行解析*/
if (grc.indexOf("json") != -1) {
if (!grc || grc.indexOf("json") != -1) {
/*转换为js对象*/
result = JSON.parse(xhr.responseText);
} else if (grc.indexOf("xml") != -1) {
Expand Down

0 comments on commit dc1ba4d

Please sign in to comment.