i wonder if i use
google.load("jquery", 1);
google.setOnLoadCallback(function() {
// i still need to check if document has finished loading with
$(function() {
// do stuff
});
});
the question is when google.setOnLoadCallback() is called it does not mean the document has finished loading right? or can i do stuff like ... below ... straight away?
google.setOnLoadCallback(function() {
$("#elem").doSomething();
});
From Google AJAX API docs:
window.loadwill always fire afterDOMContentLoadedthat is the equivalent ofjQuery(document).readyfor most cases. When not available, jQuery will fallback toonreadystatechangeoronload(IE), orload(standard).Since worst case if both jQuery and google falling back to the
loadevent, you can safely use the second method.