JS Bigquery example working in chrome/firefox but not in IE? -
the below example given in google developers, working in chrome/firfox out having issues not in ie , using ie version#11 (latest) in windows 8.1.
the chart not displaying in ie , java script error getting.![enter image description here][1]
note: 1. similar error getting when use google developers-json example also...to fetch records bigquery , showing in table...like executing in chrome/firefox not in ie??? 2. if possible can please provide , asp.net web application example, connect google bigquery , showing data in gridview c#.net (not asp.net mvc)
<html> <head> <script src="https://apis.google.com/js/client.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> <script type="text/javascript" src="http://www.google.com/jsapi"></script> <script type="text/javascript"> google.load('visualization', '1', { packages: ['geochart'] }); </script> <script> // update use project id , client id var project_id = 'xxxxxxxxx'; var client_id = 'xxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com'; var config = { 'client_id': client_id, //'p12_key': 'keys/ab2c867e84d6d629f0a80595ae14fdbe44492de8 - privatekey.p12', //'service_account' : '87853623787-7lsfbcuu9p3gr9o76opp5fkrvhdf0itk@developer.gserviceaccount.com', 'scope': 'https://www.googleapis.com/auth/bigquery' }; function runquery() { var request = gapi.client.bigquery.jobs.query({ 'projectid': project_id, 'timeoutms': '30000', 'query': 'select state, avg(mother_age) theav [publicdata:samples.natality] year=2000 , ever_born=1 group state order theav desc;' }); request.execute(function (response) { console.log(response); var statevalues = [["state", "age"]]; $.each(response.result.rows, function (i, item) { var state = item.f[0].v; var age = parsefloat(item.f[1].v); var statevalue = [state, age]; statevalues.push(statevalue); }); var data = google.visualization.arraytodatatable(statevalues); var geochart = new google.visualization.geochart( document.getelementbyid('map')); geochart.draw(data, { width: 556, height: 347, resolution: "provinces", region: "us" }); }); } function auth() { gapi.auth.authorize(config, function () { gapi.client.load('bigquery', 'v2', runquery); $('#client_initiated').html('bigquery client initiated'); }); $('#auth_button').hide(); } </script> </head> <body> <h2>average mother age @ first birth in 2000</h2> <button id="auth_button" onclick="auth();">authorize</button> <button id="query_button" style="display:none;" onclick="runquery();">run query</button> <div id="map"></div> </body> </html>
perhaps because have console.log() statement , ie doesn't that.
Comments
Post a Comment