1

I am trying to make a Chrome extension so that when I open a new tab, it is a simple page where I can make a list of To-Do's.

<!DOCTYPE html>
<html>

<head>
     <script src="indexdb.js"></script>
</head>


<h2 id="toc-final">To Do List</h2>
<ul id="todoItems"></ul>
<input type="text" id="todo" name="todo" placeholder="What do you need to do?" style="width: 200px;">
<input type="submit" id="newitem" value="Add Todo Item" onclick="addTodo(); return false;">


</html>

I am using the javascript from http://jsfiddle.net/unclelongmao/VrS32/
My new tab has the text input box, but when I press the submit button, nothing happens. I am not sure why this is happening.

Jason Woo
  • 271
  • 1
  • 6
  • 16
  • are you certain that `src` path is correct? You could replace ` – Shawn Mehan Nov 24 '15 at 01:47
  • whats the web console say – mattdevio Nov 24 '15 at 01:57
  • I think it's a Chrome-specific conflict. When I open the html file from my folder, it works properly. However when it's loaded as the new tab, it does not work. – Jason Woo Nov 24 '15 at 02:01
  • console says: Uncaught TypeError: Cannot read property 'transaction' of null – Jason Woo Nov 24 '15 at 02:21
  • 1
    Possible duplicate of [onClick within Chrome Extension not working](http://stackoverflow.com/questions/13591983/onclick-within-chrome-extension-not-working) – wOxxOm Nov 24 '15 at 10:03
  • Could be coz of Content Security Policy: https://developer.chrome.com/extensions/contentSecurityPolicy – user1953366 Jul 12 '18 at 02:02

0 Answers0