I can't tell from the code you posted, but from your description, it sounds like you might be loading the charts code after the document has finished loading. The consequence of doing that is that loading more code will try to write out more script tags, but that might overwrite your entire document instead, which could result in the message you are seeing.
There is a way to load the charts code even so, but you have to change how you load the code. Read about "dynamic loading" here: https://developers.google.com/chart/interactive/docs/library_loading_enhancements#enhancedloading which links to: https://developers.google.com/loader/#Dynamic On Wed, Apr 29, 2015 at 11:14 PM, Esteban orue <[email protected]> wrote: > I create a chart basing on user ranking that I get from database, I've a > page where I list all the users (Users.jsp) and I load with ajax the user > details (userDetails.jsp), in the user details I create the chart with the > parameters that I receive depending the user: > > String user = (request.getParameter("username") != null ) ? > request.getParameter("username") : ""; > String isWebUser = (request.getParameter("isWebUser") != null ) ? > request.getParameter("isWebUser") : ""; > > <!--Here I fill the array with some values and I pass those values to the > chart--> > > <script type="text/javascript" > src="https://www.google.com/jsapi?autoload={ > 'modules':[{ > 'name':'visualization', > 'version':'1', > 'packages':['corechart'] > }] > }"></script> > <!-- <script type="text/javascript" src="https://www.google.com/jsapi > "></script>--> > <script type="text/javascript"> > //google.load('visualization', '1', {packages: ['corechart', 'line']}); > //google.load('modules':[{'name':'visualization', 'version':'1', > 'packages':['corechart']}]); > google.setOnLoadCallback(drawChart); > function drawChart() { > var data = google.visualization.arrayToDataTable([ > ['Notas','<%=user%>','<%=usuario7d %>'], > <% for ( int j=0; j < 7; j++) { %> > [ <%=j %>, <%=vectFinal_7[j][1] %>, <%=vectFinal_7MR[j][1] %> ], > <% } %> > ]); > var options = { > title: '7 dias', > curveType: 'function', > legend: { position: 'bottom' } > }; > var chart = new > google.visualization.LineChart(document.getElementById('curve_chart_7')); > chart.draw(data, options); > } > </script> > <script type="text/javascript"> > google.setOnLoadCallback(drawChart); > function drawChart() { > var data = google.visualization.arrayToDataTable([ > ['Notas','<%=user%>','<%=usuario30d %>'], > <% for ( int j=0; j < 30; j++) { %> > [ <%=j %>, <%=vectFinal_30[j][1] %>, <%=vectFinal_30MR[j][1] %>], > <% } %> > ]); > var options = { > title: '30 dias', > curveType: 'function', > legend: { position: 'bottom' } > }; > var chart = new > google.visualization.LineChart(document.getElementById('curve_chart_30')); > chart.draw(data, options); > } > </script> > > The point is that when I called this jsp the chart is rendered but when I > called the first page where I list the users and then called one particular > I have this error: > > A call to document.write () from a loaded external script asynchronously > was ignored. > > I really don't know why > > <!--Load the AJAX API --> > <script type="text/javascript" src="http://www.google.com/jsapi"></script> > > don't load correctly. > > Can someone help me? > > -- > You received this message because you are subscribed to the Google Groups > "Google Visualization API" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to > [email protected]. > Visit this group at > http://groups.google.com/group/google-visualization-api. > For more options, visit https://groups.google.com/d/optout. > -- Daniel LaLiberte <https://plus.google.com/100631381223468223275?prsrc=2> - 978-394-1058 [email protected] <[email protected]> 5CC, Cambridge MA [email protected] <[email protected]> 9 Juniper Ridge Road, Acton MA -- You received this message because you are subscribed to the Google Groups "Google Visualization API" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/google-visualization-api. For more options, visit https://groups.google.com/d/optout.
