javascript - JS doesnt work in Chrome Extension -


my javascript doesn't work in google chrome extension. never worked google chrome extensions before , don't know how handle problem. want embed js in html, doesn't work. see calculator, buttons anything. if type in numbers , press enter, numbers deleted , nothing happens.

here html , js:

home html

<html>     <head>          <title>afmo</title>         <style>             body {                 min-width:200;                 min-height:400;                 overflow-x: hidden;             }         </style>             </head>     <body>     <a href="calculator.html">calculator</a>        <p>         <id="links">         <a href="calculator.html" target="_calculator2"><img src="icon/twitter.png" width="64" height="64"/></a>         <a href="https://twitter.com/" target="_twitter"><img src="icon/twitter.png" width="64" height="64"/></a>         <a href="https://www.facebook.com/" target="_facebook"><img src="icon/facebook.png" width="64" height="64"/></a>         <a href="http://instagram.com/" target="_instagram"><img src="icon/instagram.png" width="64" height="64"/></a>         <a href="http://www.youtube.com/" target="_youtube"><img src="icon/youtube.png" width="64" height="64"/></a>         <a href="https://www.blogger.com/" target="_blogger"><img src="icon/blogger.png" width="64" height="64"/></a>         <a href="https://vimeo.com/" target="_vimeo"><img src="icon/vimeo.png" width="64" height="64"/></a>         </id>     </p>     </body> </html> 

linked html

    <html> <head> <title>taschenrechner</title> <style type="text/css"> .button {  width:60px; text-align:center;            font-family:system,sans-serif;            font-size:100%; } .display { width:100%; text-align:right;            font-family:system,sans-serif;            font-size:100%; } </style> </head> <body bgcolor="#ffffe0" onload="calculator.js">  <form name="rechner" action="" onsubmit="ergebnis();return false;"> <table border="5" cellpadding="10" cellspacing="0"> <tr> <td bgcolor="#c0c0c0"> <input type="text" name="display" align="right" class="display"></td> </tr><tr> <td  bgcolor="#e0e0e0"> <table border="0" cellpadding="0" cellspacing="2"> <tr> <td><input type="button" width="60" class="button" value="  7   " onclick="hinzufuegen('7')"></td> <td><input type="button" width="60" class="button" value="  8   " onclick="hinzufuegen('8')"></td> <td><input type="button" width="60" class="button" value="  9   " onclick="hinzufuegen('9')"></td> <td><input type="button" width="60" class="button" value="  +   " onclick="hinzufuegen('+')"></td> </tr> <tr> <td><input type="button" width="60" class="button" value="  4   " onclick="hinzufuegen('4')"></td> <td><input type="button" width="60" class="button" value="  5   " onclick="hinzufuegen('5')"></td> <td><input type="button" width="60" class="button" value="  6   " onclick="hinzufuegen('6')"></td> <td><input type="button" width="60" class="button" value="  -   " onclick="hinzufuegen('-')"></td> </tr> <tr> <td><input type="button" width="60" class="button" value="  1   " onclick="hinzufuegen('1')"></td> <td><input type="button" width="60" class="button" value="  2   " onclick="hinzufuegen('2')"></td> <td><input type="button" width="60" class="button" value="  3   " onclick="hinzufuegen('3')"></td> <td><input type="button" width="60" class="button" value="  *   " onclick="hinzufuegen('*')"></td> </tr> <tr> <td><input type="button" width="60" class="button" value="  0   " onclick="hinzufuegen('0')"></td> <td><input type="button" width="60" class="button" value="  .   " onclick="hinzufuegen('.')"></td> <td><input type="button" width="60" class="button" value="  =   " onclick="ergebnis()"></td> <td><input type="button" width="60" class="button" value="  /   " onclick="hinzufuegen('/')"></td> </tr> <tr> <td><input type="button" width="60" class="button" value="sqrt " onclick="sonderfunktion('sqrt')"></td> <td><input type="button" width="60" class="button" value=" pow " onclick="sonderfunktion('pow')"></td> <td><input type="button" width="60" class="button" value=" ln " onclick="sonderfunktion('ln')"></td> <td><input type="reset"  width="60" class="button" value="  c  "></td> </tr> </table> </td></tr></table> </form>  </body> </html> 

js

    function check (eingabe) {   var nur_das = "0123456789[]()-+*%/.";   (var = 0; < eingabe.length; i++)     if (nur_das.indexof(eingabe.charat(i)) < 0)       return false;   return true; }  function ergebnis () {   var x = 0;   if (check(window.document.rechner.display.value))     x = eval(window.document.rechner.display.value);   window.document.rechner.display.value = x; }  function hinzufuegen (zeichen) {   window.document.rechner.display.value = window.document.rechner.display.value + zeichen; }  function sonderfunktion (funktion) {   if (check(window.document.rechner.display.value)) {     if (funktion == "sqrt") {       var x = 0;       x = eval(window.document.rechner.display.value);       window.document.rechner.display.value = math.sqrt(x);     }     if (funktion == "pow") {       var x = 0;       x = eval(window.document.rechner.display.value);       window.document.rechner.display.value = x * x;     }     if (funktion == "ln") {       var x = 0;       x = eval(window.document.rechner.display.value);       window.document.rechner.display.value = math.log(x);     }   } else     window.document.rechner.display.value = 0} 

some more info: our own chrome app. copied calculator, wont release app, guess doesnt matter.

edit comes in console when press number on calculator. refused execute inline event handler because violates following ""see below"" content security policy directive: "script-src 'self' chrome-extension-resource:". either 'unsafe-inline' keyword, hash ('sha256-...'), or nonce ('nonce-...') required enable inline execution. tried fix this, , cant find inline script.

""see below""
here stands line of button. if press 7, there comes error in line 25, if press 3 error in 39. guess have put the

<td><input type="button" width="60" class="button" value="  4   " onclick="hinzufuegen('4')"></td> 

in js, dont know how this

where <script> tag?
should like:

<script src="yourjsfile.js"></script> 

Comments

Popular posts from this blog

java - Oracle EBS .ClassNotFoundException: oracle.apps.fnd.formsClient.FormsLauncher.class ERROR -

c# - how to use buttonedit in devexpress gridcontrol -

nvd3.js - angularjs-nvd3-directives setting color in legend as well as in chart elements -