When attempting to access a google sheet from the javascript in my PhoneGap 
application the callback function on the query.send never gets fired. 
Anybody know what I could be doing wrong? The html contains:
<script type="text/javascript" charset="utf-8" 
src="script/gviz-api.js"></script>
...and here is my javascript code:

function googleProcess() {
var req = 'select *';
var reqenc = encodeURIComponent(req);
//var DATA_SOURCE_URL = 
"https://docs.google.com/spreadsheets/d/1aHDluVPJjJFvodTj2KafxkmDk37AuzZkT7bAvagJV0k/edit?usp=sharing";;
var DATA_SOURCE_URL = 
"https://docs.google.com/spreadsheets/d/138AvNVJklhwJeiyRxHilgtxY2zwudw0Nk3Klfgk7Tls/edit?usp=sharing";;
//DATA_SOURCE_URL = DATA_SOURCE_URL + "/gviz/tq?tq=" + reqenc; 
var query = new google.visualization.Query(DATA_SOURCE_URL);
try {
if (DATA_SOURCE_URL.indexOf("gviz") == -1) {
window.alert("Setting URL Without Query: " + DATA_SOURCE_URL);
console.log("Setting URL Without Query: " + DATA_SOURCE_URL);
window.alert("Query: " + req);
console.log("Query: " + req);
query.setQuery(req);
} else {
window.alert("Setting URL WITH Query: " + DATA_SOURCE_URL);
console.log("Setting URL WITH Query: " + DATA_SOURCE_URL);
}
query.send(handleQueryResponse);
} catch (e) {
window.alert("Error in Query Processing: " + e.message);
}
window.alert("Query Sent OK");
} 

function handleQueryResponse(response) {
window.alert("Handling Response");
if (response.isError()) {
        alert('Error in query: ' + response.getMessage() + ' ' + 
response.getDetailedMessage());
        return;
      }
    var data = response.getDataTable();
    window.alert("Data is: " + data);
}

-- 
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 https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-visualization-api/d2e38510-6007-46c2-9685-dbdf9d510c2b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to