Here is my main.html
file:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Page</title>
<meta name="generator" content="WYSIWYG Web Builder 16 - https://www.wysiwygwebbuilder.com">
<link href="Chromium_Güncelleştirici_Eklenti_Projesi.css" rel="stylesheet">
<link href="main.css" rel="stylesheet">
</head>
<body>
<div id="wb_Image1" style="left:0px;top:0px;width:320px;height:50px;z-index:0;">
<img src="Assets/baslik.png" id="Image1" alt=""></div>
<div id="wb_Image7" style="left:0px;top:160px;width:320px;height:35px;z-index:1;">
<img src="Assets/guncellestirmeleriDenetlePasif.png" id="Image2" alt=""></div>
<div id="wb_Image3" style="left:0px;top:87px;width:320px;height:36px;z-index:3;">
<img src="Assets/ayarlarPasif.png" id="Image3" alt=""></div>
<div id="wb_Image4" style="left:0px;top:123px;width:320px;height:72px;z-index:4;">
<img src="Assets/hakkindaPasif.png" id="Image4" alt=""></div>
<script src="../Data/deneme.js" type="module">
</body>
</html>
Here is my deneme.js
file:
document.addEventListener
(
'DOMContentLoaded',
function()
{
var dugme = document.getElementById('Image2');
dugme.addEventListener
(
'click',
function()
{
console.log('Merhaba Dünya!');
}
);
}
);
But the problem is, when I click the Image2
, the browser does not respond.
I did not write JS code into my main.html
file; because Chromium blocks my extension (Content Security Policy).
So, what should I do?
You didn't close the script tag.
Try below html, it should work fine:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Page</title>
<meta name="generator" content="WYSIWYG Web Builder 16 - https://www.wysiwygwebbuilder.com">
<link href="Chromium_Güncelleştirici_Eklenti_Projesi.css" rel="stylesheet">
<link href="main.css" rel="stylesheet">
</head>
<body>
<div id="wb_Image1" style="left:0px;top:0px;width:320px;height:50px;z-index:0;">
<img src="Assets/baslik.png" id="Image1" alt=""></div>
<div id="wb_Image7" style="left:0px;top:160px;width:320px;height:35px;z-index:1;">
<img src="Assets/guncellestirmeleriDenetlePasif.png" id="Image2" alt=""></div>
<div id="wb_Image3" style="left:0px;top:87px;width:320px;height:36px;z-index:3;">
<img src="Assets/ayarlarPasif.png" id="Image3" alt=""></div>
<div id="wb_Image4" style="left:0px;top:123px;width:320px;height:72px;z-index:4;">
<img src="Assets/hakkindaPasif.png" id="Image4" alt=""></div>
<script src="../Data/deneme.js" type="module"></script>
</body>
</html>