Chrome extension options not calling javascript file

I have an options page in my Chrome extension that calls a javascript file. I tried using javascript to save my parameters, but it didn't work, so I tested it with very simple code:

options.html

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
</head>
<body>
    <script type="text/javascript" src="jquery-1.11.2.min.js"></script>
    <script type="text/javascript" src="options.js"></script>
</body>
</html>

      

options.js

$(document).ready(function() {
  alert('loaded');
  console.log('loaded');
});

      

Neither how alert

nor console.log

does it fire when I click options

on the Chrome extensions page. This leads me to think that the file is options.html

not loading the file js

, but it may be that I am mistaken in expecting that alert

and console.log

will work the way they do with extensions.

Any ideas what is going wrong here?

+3


source to share


1 answer


To see the results of either console.log

, you need to right-click on the modal options box and select Inspect Element. Any console messages will be displayed here.



However, the commands alert

seem to be overwhelmed, or at least I haven't been able to see them.

+7


source







All Articles