Advertisement
ForeverDev

Untitled

Oct 11th, 2014
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /* I'm trying to make an extremely simple chrome extension that alerts something when you click a button, but it's not working.  Can anyone help?  This is what I have right now: */
  2.  
  3. //**popup.html**
  4.  
  5.     <html>
  6.         <body>
  7.             <input type = "button" id = "aButton" value = "My button" ></input>
  8.         </body>
  9.     </html>
  10.  
  11. //**popup.js**
  12.  
  13.     src = "http://code.jquery.com/jquery-1.10.2.js"
  14.    
  15.     $(document).ready(function() {
  16.         $("#aButton").click(function() {
  17.             alert("You clicked me!")
  18.         })
  19.     })
  20.  
  21. //**manifest.json**
  22.  
  23.     {
  24.       "manifest_version": 2,
  25.       "name": "Test",
  26.       "description": "Test Extension",
  27.       "version": "1.0",
  28.    
  29.       "icons": {
  30.         "48": "icon.png"
  31.        },
  32.    
  33.       "permissions": [
  34.         "http://*/*",
  35.         "https://*/*"
  36.       ],
  37.    
  38.       "browser_action": {
  39.         "default_title": "This is a test",
  40.         "default_icon": "icon.png",
  41.         "default_popup": "popup.html"
  42.       }
  43.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement