google.load - and message "google is not defined"
ajax, google-api, javascript
Solution
I had the same problem and solved it like this:
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type='text/javascript'>
function LoadGoogle()
{
if(typeof google != 'undefined' && google && google.load)
{
// Now you can use google.load() here...
}
else
{
// Retry later...
setTimeout(LoadGoogle, 30);
}
}
LoadGoogle();
</script>
The idea is to retry until google is defined.
The other solutions didn't help me, probably because this piece of code is loaded via Ajax from another page.
Problem
What do I need to include to do a `google.load()` statement? I'm getting the error: ``` google is not defined ``` Based on this page, I thought I should add this: ``` <script type="text/javascript" src="http://www.google.com/jsapi?key=ABCDEFG"> </script> ``` But when I did, I got this error: ``` "window.LoadFirebugConsole" is not a function. ```