Uncaught TypeError: Object # has no method 'addPanel'

前端 未结 3 832
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-21 12:10

I am trying to implement an almost cross-browser bookmark functionality and found this on SO: How do I add an "Add to Favorites" button or link on my website?

3条回答
  •  春和景丽
    2020-12-21 12:39

    It's possible that the WordPress theme you are using has an element with id=sidebar.

    Unless a global variable with the same name has been explicitly defined, a global variable will be created for each element that has an id.

    So, the first test is unreliable. For example, evaluating window.sidebar on the stackoverflow page will be true even in Chrome, because the website uses an element with such an id.

提交回复
热议问题