I put a javascript function in my ruby on rails4 web page but it didn't work properly. My page not shows the map when I open my webpage but when I reload my webpage then map show properly. I put my javascript tag in body of my webpage. What should I do for proper working of code and where should I put my code that it can works properly?I put a javascript function in my ruby on rails