Very Simple Javascript Doesn't Work At All
my javascript in .php (static website) file doesn't work. I use there 3 other scripts and they do work, but not this one. The situation is simple The javascript is... var myFile =
Solution 1:
Put the script right at the end of the body, right before the </body>
end tag.
Scripts are loaded synchronously where they are placed, so any script put in before the element in question will not be aware of the element's existence.
Also, what Igor said.
Solution 2:
You don't have a DOM element with id "myFile" in html that you included.
Post a Comment for "Very Simple Javascript Doesn't Work At All"