Hi!
In Mozilla add-ons (created with WebExtention) I need put some button on the sidebar and add “onclik” event on it.
I wrot simple code in sidebar HTML file:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="panel.css"/>
</head>
<body>
<h2 style="text-align: center">Pages</h2>
<form action="">
<input id="bttn" type="button" value="Prev" onclick="showNext()">
</form>
<script src="panel.js"></script>
</body>
</html>
where file panel.js has such content:
function showNext() {
alert("ok");
}
But when I press button “Prev”, “alert” window, doesn’t appear.
I have tried to make even more simply and used only sidebar HTML file:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="panel.css"/>
</head>
<body>
<h2 style="text-align: center">Pages</h2>
<form action="">
<input id="bttn" type="button" value="Prev" onclick="alert("ok")">
</form>
<script src="panel.js"></script>
</body>
</html>
…same result (
What wrong?
P.S. sidebar is shown correctly