DRYな備忘録

Don't Repeat Yourself.

DOMドキュメントに、フレームワークのjsとかcssが乗らない【HTML】【javascript】【winktoolkit】

【問題】

htmlで作ったDOMドキュメントに、

winktoolkitのjsを乗せようとしたが、

Uncaught TypeError: Cannot call method 'appendChild' of null

と叱られる。

もちろん、jsの挙動はしない。

 

【原因】

<script>
$(function(){
(中略)
  $('ouutput').appendChild(accordion.getDomNode());
});
</script>
</head>
<body>
<div id="output">
</div>
 

【解決】

$(function(){
    (中略)
    $('output').appendChild(accordion.getDomNode());
});

とした。

 

DRY