Hello,

I'm trying to get server response which is a string literal used to build 
the table but for some reason I cannot get it to work.  I'm getting an 
error on:  
var dataresults = google.visualization.DataTable(data.toString(), 0.6);

My code:
<%-- 
    Document   : index
    Created on : Nov 14, 2013, 9:49:13 PM
    Author     : Ronald
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<script 
src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js";></script>
<script type="text/javascript" src="https://www.google.com/jsapi";></script>

<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JQuery Ajax Server Call Demo</title>
    </head>
    <body>
        <h2>This will attempt to demonstrate JQuery's ability to submit a 
server request and response without refreshing</h2>

        <input type="button" value="Load Example" 
onclick="load_page_example();" />
        <input type='button' value="Servlet Request" 
onclick="load_response_example();" />
    </body>

    <div id='div_processed'></div>
</html>

<script type="text/javascript">
            function load_page_example() {
                $("#div_processed").load("div_load.jsp");




            }

            function load_response_example() {
                
$.post("http://localhost:8084/JQuery_Server_Response_Demo/Process";,
                        {
                            text: "parameter"
                        },
                function(data, status) {
                    
                    
                    
                    loadChart(data);


                }
                );

            }
            
            function loadChart(data){

                google.load("visualization", "1", {packages: ['table']});
                
                    //google.setOnLoadCallback(drawChart);
                  
                       
                        var dataresults = 
google.visualization.DataTable(data.toString(), 0.6);

                        var options = {
                            title: 'Company Performance'
                        };

                        var table = new 
google.visualization.Table(document.getElementById('div_processed'));
                        table.draw(dataresults);
                        
                       alert("At end of google chart build");


                    
            
           
            }
</script>

-- 
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/groups/opt_out.

Reply via email to