Tag: jsapi

Google Charts API使用$(document).ready方法显示空白屏幕

我有几个使用Google Charts API实例化各种图表的函数。 当我在没有jQuery的$(document).ready方法的情况下调用它们时,一切正常。 但是用这种方法,我看着空白屏幕。 为什么? function drawColumnChart1(){..some code..} function drawColumnChart2(){..some code..} function drawGeoChart(){.some code..} //This works fine. google.load(“visualization”, “1”, {packages:[“piechart”, “corechart”, “geomap”]}); google.setOnLoadCallback(window.drawColumnChart1); google.setOnLoadCallback(window.drawColumnChart2); google.setOnLoadCallback(window.drawGeoChart); //This doesn’t work $(document).ready(function(){ google.load(“visualization”, “1”, {packages:[“piechart”, “corechart”, “geomap”]}); google.setOnLoadCallback(window.drawColumnChart1); google.setOnLoadCallback(window.drawColumnChart2); google.setOnLoadCallback(window.drawGeoChart); }); 更新以下是我在Firebug中遇到的错误: uncaught exception: [Exception… “Could not convert JavaScript argument” nsresult: “0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS)” location: “JS frame :: […]