InvalidValueError: not an instance of HTMLInputElement

前端 未结 8 1661
刺人心
刺人心 2020-12-09 08:23

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

8条回答
  •  误落风尘
    2020-12-09 09:04

    This has been my problem while following the tutorial on Google. The problem is that you should execute the javascript after the page loads, you can call the function on the GET parameter while calling the Google Map script:

    
    

    YourFunctionHere is a callback function means it will only execute after the page loads.

    Or you can can call functions after the page loads. Example: window.onload = Yourfunction();

    Now, inside that function is where you would do your Google Maps API stuff like document.getElementById('source_map') and all methods that belong to the google class.

提交回复
热议问题