Loading Google Chart Api using Ajax in html page

cocontamau

New Member
I am using Ajax code to load the html page for example:\[code\] $.ajax({ url: 'Context.html', dataType: 'html', timeout: 500, success: function(html) { $("div#mainbody").html(html); } });\[/code\]The Context.html I am loading it in some other html page say Home.htmlBut I am generating pie charts using google API in Context.htmland the code for generating pie chart i.e in Context.html is\[code\]<script type="text/javascript" src="https://www.google.com/jsapi"></script><script type="text/javascript"> google.load("visualization", "1", {packages:["corechart"]}); google.setOnLoadCallback(drawChart); function drawChart() { var data = http://stackoverflow.com/questions/12741654/google.visualization.arrayToDataTable([ ['Year', 'Count'], ['2005', 70], ['2006', 80], ['2007', 140], ['2008', 220], ['2009', 290], ['2010', 400], ['2011', 500] ]); var options = { title: 'Head Count-(Apple Year)', colors:['#129212'] }; var chart = new google.visualization.ColumnChart(document.getElementById('jsf_headcount_bargraph')); chart.draw(data, options); } </script> \[/code\]When I am loading Context.html in Home.html page I cannot find the pie chart which is in Context.html after loading it in the Home.htmlI tried by giving ALERT(""); in script where I wrote code for pie chart. I was getting alert message,so Ajax is executing javascript but I am not getting pie chart which is same script. So I was stucked with Loading pie chart in Home.html pageCan anyone help me..Thanks in Advance..
 
Back
Top