私は次のJSコードを持っています。test.php が読み込まれ、ボタンをクリックすると、表示機能が呼び出されません。これを FF で試しています。ここで何が間違っているかについての提案。
test.php
<script type="text/javascript" src="http://localhost/test1.js"></script>
<script type="text/javascript" src="http://localhost/test2.js"></script>
test1.js
function show()
{
alert("hello");
}
test2.js
function showHTML()
{
var html = "<!DOCTYPE html>";
html += "<html><body>";
html += "<input type='button' name='button' style='width:100px;height:50px;' onclick='show();' />";
html += "</body></html>";
document.write(html);
}
window.addEventListener("load", function() {
alert("eevnet");
showHTML();
}, false);