end0tknr's kipple - web写経開発

太宰府天満宮の狛犬って、妙にカワイイ

jQueryによるjavascriptの動的loadは難しいらしく

次のように書くと、上手く動的loadを実現できるらしい

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js">
</script>
</head>
<body>

<img src="http://www.st-hatena.com/users/en/end0tknr/user.jpg?1236178978">

<!-- jQueryによるjavascriptの動的loadは難しいらしい -->
<script>
$(document).ready(function(){
   var script = document.createElement('script');
   script.src = "./test.js";
   document.getElementsByTagName("head")[0].appendChild(script);
});
</script>
</body>
</html>

参考url
http://temping-amagramer.blogspot.jp/2012/02/jqueryjavascriptscript.html
http://d.hatena.ne.jp/syttru/20090422/1240414814