Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
79
rated 0 times [  84] [ 5]  / answers: 1 / hits: 34050  / 15 Years ago, fri, august 28, 2009, 12:00:00

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.

More From » ajax

 Answers
82

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.


[#98804] Wednesday, August 26, 2009, 15 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
zahrafrancisr

Total Points: 176
Total Questions: 105
Total Answers: 99

Location: Svalbard and Jan Mayen
Member since Sun, Sep 25, 2022
2 Years ago
;