- Home /
Question by
hypertuned · Jun 11, 2015 at 10:42 AM ·
chrome
buton click doesn't call function in chrome
I am trying to call a function in chrome and receive this error on button click. What I actually want to do is to assign value as status=1 and if (status==1) I am gonna call another function in popup.js. I also tried to do this (onbuttonclick="status=1") and it didn't work either. Heres the error.
refused to execute inline event handler because it violates the following content security policy directive*
popup.html
<html>
<head>
<script src="popup.js"></script>
</head>
<body>
<button style="background-color:transparent; cursor:pointer; border:0;"
onclick="myfunc()"><img src="green.png" style="height:40px;width:35px;" >
</body>
</html>
popup.js
var status;
function myfunc()
{
alert("hello");
status=1;
}
buttonerror.png
(99.7 kB)
Comment