See http://jsfiddle.net/QJVUr/1/ for an example - works fine in FF but not in Chrome.
On the opposite side; removing the google.setOnLoadCallback works in Chrome but not Firefox: http://jsfiddle.net/RTQ5S/
Any ideas on a compromise?
I am guessing Chrome doesn't run the setOnLoadCallback because it has already loaded.
I would suggest two things:
window.addEvent('domready', function(){..});
with google.setOnLoadCallback(function(){...});
. Hopefully that helps; I'm not sure if there's a reason they way you're doing things the way you are that means the above options aren't what you're looking for, so if that's the case feel free to give more specifics in your question.
Instead of using setOnCallback set the callback in the library load.
See http://jsfiddle.net/QJVUr/10/
google.load('visualization', 1, {packages:['corechart'], callback: drawChart});
Per Google dev docs, if library is already loaded, it is not loaded again, rather the callback is immediately called.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.