Why does google.load cause my page to go blank?

Looks like google.load is adding the script to the page using a document.write(), which if used after the page loads, wipes out the html.

This explains more in-depth:
http://groups.google.com/group/google-ajax-search-api/browse_thread/thread/e07c2606498094e6

Using one of the ideas, you could use a callback for the load to force it use append rather than doc.write:

setTimeout(function(){google.load('visualization', '1', {'callback':'alert("2 sec wait")', 'packages':['corechart']})}, 2000);

This demonstrates the 2 second wait with the delayed alert window

Leave a Comment