0

I am new to coding and trying to make a chrome app which basically displays a bunch of fake error messages. I called to the image with a button, but the image is not showing up. Could someone please help and tell me what I am doing wrong?? Here is the code;

I was having some trouble with the putting the code in, so... http://pastebin.com/iTtmLVE5

Mdbook
  • 41
  • 2
  • 6

1 Answers1

1

There's nothing wrong with ur code, but with its implementation. First open console (F12) and check if js file has been loaded properly. Also You should really consider where to put ur external javascript files. Usually they are placed in html head tag or just before closing body tag .

The difference between both of them is that, if u place js file in header, its loading priority is high, so it loads before DOM (Document Object Model, so just a HTML structure) and when u place it before body closing tags, DOM will load first, so user can see inetrface faster (Since js is loading after browser renders it).

After copy & paste of ur code and making a little cleaning it works. What i've done was deleting all unneccessary HTML code, changing js file name to something more expressive (in my case script.js) and everything worked well.

  • Could you send me a copy of what you did? I tried editing it, but it didn't work. Sorry, I'm pretty new to code. – Mdbook Jan 10 '16 at 20:23
  • I think it's a problem with the chrome-app running software. Thanks for your help! – Mdbook Jan 11 '16 at 12:39