FYI, I\'m not a JavaScript Ninja but felt like I\'ll become one when I did a lot of things based on Google Maps recently.
I implemented a map. User can search for go
This is an issue of DOM. Your javascript loads before loading your html document.
Make sure your html elements load first and then only load javascript.
Like
and then