Javascript错误 - 无法调用null的方法'appendChild'(svgicons)

时间:2015-07-07 09:36:47

标签: javascript svg

我在Chrome开发者工具中收到此错误,但我无法在页面上看到任何错误。

以下是JS的简短摘录:

$("selector").click(function() {
  $(this).doSomething();
});

我相信此代码并不多见,因此可以在此处找到该页面:http://goo.gl/j7M5r8

我已经尝试通过查看Stackoverflow上的其他类似案例来解决问题,并指出存在缺少的东西或者其中读取/写入的顺序。

我没有写过 svgicons.js ,所以不应该有任何问题。但是我可以看到有些问题与我有同样的问题,但是没有为这个问题提供解释或答案。 Here is basically the same question from another person.

相关文件:

http://goo.gl/0RisGa

http://goo.gl/UgWHMS

http://goo.gl/X269NO

1 个答案:

答案 0 :(得分:1)

检查你的hamburger_animations.js文件 - 它位于http://www.vekvemedia.no/wp-content/themes/vekvemedia/js/hamburger_animation.js

(function() {                           
    [].slice.call( document.querySelectorAll( '.si-icons-default > .si-icon' ) ).forEach( function( el ) {
        var svgicon = new svgIcon( el, svgIconConfig );
    } );
    new svgIcon( document.querySelector( '.si-icons-easing .si-icon-hamburger' ), svgIconConfig, { easing : mina.backin } );
    new svgIcon( document.querySelector( '.si-icons-easing .si-icon-hamburger-cross' ), svgIconConfig, { easing : mina.elastic, speed: 600              } );
    })();

document.querySelector( '.si-icons-easing .si-icon-hamburger' )导致null

相关问题