I have an options page in my Chrome extension which calls a javascript file. I tried using javascript to save my options but it wasn't working, so I tested it with some 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 the alert
nor the console.log
seems to be firing when I click options
in the Chrome extensions page. This makes me think that the options.html
file isn't loading the js
file, but it could be that I'm wrong to expect alert
and console.log
to work like this with extension options.
Any ideas what's going wrong here?
To see the results of any console.log
you need to right-click on the options modal window and select "Inspect Element". Any console messages will appear here.
However alert
commands appear to be suppressed, or at least I was unable to see any.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With