3
我有一個Ajax調用Ajax jQuery錯誤「谷歌沒有定義」?
$.ajax({
url: "dashboard.phtml",
cache: false,
success: function(content){
$(#div).html(content);
}
});
和我dashboard.phtml是
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript" src="jquery-1.6.2.min.js"></script>
<script type="text/javascript">
google.load("visualization", "1", {packages:["corechart"]});
function drawChartPie1() {
var data = new google.visualization.DataTable();
data.addColumn('string', 'Topping');
data.addColumn('number', 'Slices');
data.addRows([
['Open', openProjectsNum],
['Done', completedProjectsNum],
['Hold', onHoldProjectsNum]
]);
var options = {
'backgroundColor' : '#f8f8f8',
'legend' : 'right',
'title':'Project Status',
'titleTextStyle':{
color: 'dimgray',
fontSize: '14'
},
'colors':['#dc3912','#349853','#ea8706'],
'chartArea.width':'auto',
'chartArea.height':'auto',
'height':'200',
'width' : '260'
}
var chart = new google.visualization.PieChart(document.getElementById('chart_div00'));
chart.draw(data,options);
}
var completedProjectsNum = 1;
var openProjectsNum = 2;
var onHoldProjectsNum = 3;
google.setOnLoadCallback(drawChartPie1);
</script>
但AJAX調用時我收到「谷歌是沒有定義」的錯誤...請幫我整理解決這個問題。顯示該錯誤是在jquery-1.6.2.min.js。由於此錯誤,圖表未繪製。我該怎麼辦 ?