javascript not being executed in developing chrome extensions

obeptempixnex

New Member
I am a beginner developing chrome extension . I have written the following code in json file\[code\] { "name":"SecondExtension", "version":"1.0", "manifest_version":2, "content_security_policy": "script-src 'self';object-src 'self'", "permissions":["tabs", "http://*/*", "https://*/*"], "browser_action": { "defaul_icon":"icon.png", "default_title":"Security" , "default_popup":"pops.html" } }\[/code\]and i have written the following code in pops.html\[code\]<html><head><script src='http://stackoverflow.com/questions/14042857/popup.js'></script></head><body><p>Username : </p></br><input type="text" id="name" height="20" width="50" /><p>Password :</p></br> <input type="password" id="password" height="20" width="50" /><a href="http://stackoverflow.com/questions/14042857/pops2.html">login</a><button id="login">login</button><textarea id="return_name" rows="2" columns="20"></textarea></body></html>\[/code\]and the code in popup.js is :\[code\] function check() { alert('its working'); } document.addEventListener('DOMContentReady', function () { document.getElementById('login').addEventListener('click',check);});\[/code\]now the problem is javscript is not running as in whenever i click on login button it's not alerting the message "it's working" . what have i missed here?
 
Back
Top