Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Refer the code below and make sure you use "PrintWriter" object in the data provider page (Servlet) to output XML/JSON data to the caller (loadFusionCharts() function) of the page </p> <pre><code>&lt;script language='JavaScript'&gt; //in the head section /* create AJAX object */ function getXMLObject() { var xmlHttp = false; try { xmlHttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e2) { xmlHttp = false; } } if (!xmlHttp &amp;&amp; typeof XMLHttpRequest != 'undefined') { xmlHttp = new XMLHttpRequest(); } return xmlHttp; } var xmlhttp = new getXMLObject(); /*function to be called "onload" of body */ function loadFusionCharts() { if (xmlhttp.readyState == 4 || xmlhttp.readyState == 0) { var url="someURL"; //URL of data provider page that gets data from database xmlhttp.open("POST", url, true); xmlhttp.onreadystatechange = handleServerResponse; xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); xmlhttp.send(null); } } /* gets called when AJAX response comes back after executing the data provider page*/ function handleServerResponse() { if (xmlhttp.readyState == 4 &amp;&amp; xmlhttp.status == 200) { var chartData = xmlhttp.responseText; if (chartData!="") { var myChart = new FusionCharts( "./FusionCharts/ScrollCombi2D.swf","ChartId", "1040", "320", "0", "0"); myChart.setXMLData(chartData); myChart.render("fcDiv"); }else{ document.getElementById('fcDiv').innerHTML="Could not get data to render the chart"; } } } &lt;/script&gt; &lt;/head&gt; &lt;body onload='loadFusionCharts()'&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload