Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IE11 leancloud不显示阅读次数 #843

Closed
cnrting opened this issue Apr 19, 2019 · 2 comments
Closed

IE11 leancloud不显示阅读次数 #843

cnrting opened this issue Apr 19, 2019 · 2 comments

Comments

@cnrting
Copy link

cnrting commented Apr 19, 2019

v6.0.0,chrome和Firefox都没问题,应该是兼容问题
控制台error消息:
SCRIPT1010: 缺少标识符
index.htm (2323,24)

  Counter('get', '/classes/Counter', { where: JSON.stringify({ url: { '$in': entries } }) })
    .done(function({results}) {  //这一行出错
      var COUNT_CONTAINER_REF = '.leancloud-visitors-count';

      if (results.length === 0) {
        $visitors.find(COUNT_CONTAINER_REF).text(0);
        return;
      }

      for (var i = 0; i < results.length; i++) {
        var item = results[i];
        var url = item.url;
        var time = item.time;
        var element = document.getElementById(url);

        $(element).find(COUNT_CONTAINER_REF).text(time);
      }
      for (var i = 0; i < entries.length; i++) {
        var url = entries[i];
        var element = document.getElementById(url);
        var countSpan = $(element).find(COUNT_CONTAINER_REF);
        if (countSpan.text() == '') {
          countSpan.text(0);
        }
      }
    })
    .fail(function ({ responseJSON }) {
      console.log(`LeanCloud Counter Error: ${responseJSON.code} ${responseJSON.error}`);
    });
}

给出的参考:
https://docs.microsoft.com/zh-cn/previous-versions/k4eee20x(v=vs.94)

@cnrting cnrting added the Bug label Apr 19, 2019
@welcome
Copy link

welcome bot commented Apr 19, 2019

Thanks for opening this issue, maintainers will get back to you as soon as possible!

@stevenjoezhang
Copy link
Contributor

是的,因为IE并不支持ES5和ES6的新特性。请使用其它浏览器。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants