Я делаю простое расширение для Chrome и мне нужно загрузить внешний файл .js из моего html, который, похоже, не работает…
файл popup.js
'use strict';
window.onload = load() {
alert("WORKS?")
var button = document.getElementById("test");
button.onclick = handler() {
alert("helo");
document.getElementById("hello").textContent="dujn";
}
}
popup.html файл
<!DOCTYPE HTML>
<html>
<head>
<script type="text/javascript" src="popup.js"></script>
</head>
<body>
<span id='hello'> Change </span>
<input type="button" value="press" id="test"/>
</body>
</html>