tags:

views:

1590

answers:

3

What do I need to include to do a google.load() statement? I'm getting error "google is not defined".

Based on this page, http://code.google.com/apis/ajax/documentation/#DetailedDocumentation I thought I should add this:

<script type="text/javascript"
        src="http://www.google.com/jsapi?key=ABCDEFG"&gt;
</script>

But when I did, I get "window.LoadFirebugConsole" is not a function.

Thanks, Neal

+1  A: 

you should include this script -- http://www.google.com/jsapi

java
+3  A: 

Did you include the google jsapi script before adding the load and callback methods? They should be in seperate script blocks.

    <script src="http://www.google.com/jsapi?key=ABCDE"&gt;&lt;/script&gt;
    <script type="text/javascript">

    google.load("jquery", "1");

    // Define our onLoad callback
    function OnLoad(){
      alert("Loaded!");
    }

    google.setOnLoadCallback(OnLoad);
    </script>

There are additional examples in the Google's 'AJAX Api's Playground'.

Greg Gianforcaro
+2  A: 

I had the problem, but I was using:

<script type="text/javascript" src="http://www.google.com/jsapi" />

It was solved by chanching the line to:

<script type="text/javascript" src="http://www.google.com/jsapi"&gt;&lt;/script&gt;

sibidiba