views:

685

answers:

2

when i use google.load() to load jquery, what do i use in place of

$(function() {
 ... 
});

is ...

google.setOnLoadCallback(function() {
 ...
});

the same thing? this may be too slow if i am loading alot with google.load()?

then will

google.load("jquery", "1.3.2", {callback: docLoaded()});

run AFTER the whole document is loaded?

A: 

I think you should be safe using $(function) still, since it will wait for google to load jQuery, it is after all a part of the document. Or am I wrong here?

I always use local versions anyway..Just feels safer, you know (:

edit: Just tested it, and it worked, just using the regular $(function)

peirix
err i did google.load("jquery", "1.3.2");google.load("maps", "2");$(function () { alert("Hello");}); and nth happened ...
iceangel89
+1  A: 

Take a look here : Google Ajax Apis Playground

The way they do it is like this :

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

function OnLoad(){
  // some Jquery instructions
}

google.setOnLoadCallback(OnLoad);
Jean-Philippe Martin