I download it, uploaded it and heres the result http://lukesspotcom.fatcow.com/indus_links/pan_zoom/index.html
But when I tried to install ir on my computer, and all see is an image. When I went to inspect the element, I dont see the generated HTML like it does with to other on on the server… Is there some reason
Hi @lurtnowski, if you open the console of the browser dev tools you see an
Uncaught TypeError: Cannot read property ‘addEventListener’ of null
at MBSE_zoom3.html:56; so it can’t find the zoom elements at this point. You have to put your JS at the end of the body so that the DOM is ready and can be queried when the script executes, not in the head.
Yes that’s how I was taught too LOL. With a few exceptions (such as async analytics scripts) it’s best practice to place all your JS at the end of the body though; this way you don’t need to subscribe to events like the beloved $(document).ready(), and more importantly, the user doesn’t have to wait for your JS to load before they can see the page content.