2 messages in com.googlegroups.google-visualization-apiProblem with Hello World sample| From | Sent On | Attachments |
|---|---|---|
| rcronald | 25 Mar 2008 08:17 | |
| VizGuy (Google) | 27 Mar 2008 02:46 |
| Subject: | Problem with Hello World sample![]() |
|---|---|
| From: | rcronald (rcro...@gmail.com) |
| Date: | 03/25/2008 08:17:57 AM |
| List: | com.googlegroups.google-visualization-api |
Hello guys, i have a problem testing the sample application the code is: My data value is: http://spreadsheets.google.com/pub?key=pNir_5FGNA2y5-h9KOz_-Og
<html> <head> <script type="text/javascript" src="http://www.google.com/jsapi"></ script> <script type="text/javascript"> google.load("visualization", "1"); function initialize() { var query = new google.visualization.Query('http:// spreadsheets.google.com/pub?key=pNir_5FGNA2y5-h9KOz_-Og'); query.send(handleQueryResponse); // Send the query with a callback function } alert('1'); google.setOnLoadCallback(initialize); // Set callback to run when API is loaded
// Query response handler function. function handleQueryResponse(response) { alert('2'); if (response.isError()) { alert('Error in query: ' + response.getMessage() + ' ' + response.getDetailedMessage()); return; }
var data = response.getDataTable(); var html = []; html.push('<table border="1">');
// Header row html.push('<tr><th>Seq</th>'); for (var col = 0; col < data.getNumberOfColumns(); col++) { html.push('<th>' + escapeHtml(data.getColumnLabel(col)) + '</ th>'); } html.push('</tr>');
for (var row = 0; row < data.getNumberOfRows(); row++) { alert('ddd'); } html.push('</table>');
document.getElementById('tablediv').innerHTML = html.join(''); }
function escapeHtml(text) { if (text == null) return '';
return text.replace(/&/g, '&') .replace(/</g, '<') .replace(/>/g, '>') .replace(/"/g, '"'); }
</script> </head>
<body> <div id="tablediv">Loading...</div> </body>




