Twitter widgets.js throws JavaScript error “Expected identifier” on IE8

前端 未结 2 1737
离开以前
离开以前 2021-01-20 00:04

Anybody run into a JavaScript error when trying to run Twitter For Web widgets.js on Internet Explorer 8 (IE8)? If so, do you know how to fix this or how to handle it gracef

2条回答
  •  心在旅途
    2021-01-20 00:21

    Found the solution,

    In widgets.js, there is a method which name is "delete" (line 364)

    "delete": function(t) {
         var e = i(t),
         n = this.get(e.slice(0, -1));
         n && delete n[e.slice(-1)]
     },
    

    and this method calling on line 1364

    l.delete(["callbacks", t.callbackName])
    

    delete is in Reserved Words list. So it causes "Expected identifier" error.

    Firstly, take widgets.js to your own host.

    js.src= "http://www.yourdomain.com/widgets.js";
    

    change here with your domain.

    After or before that step In widgets.js, have to change "delete" method name and caller line.

提交回复
热议问题