В порядке бреда
<div id="test"></div>
<div id="test2"></div>
<script>
var idfromURL="16gDZVsB8FOIxrsFKbkbBNWC37lPUAfKOGf-rCVxeOmY";
var sheetsWeNeed =["parts","system","images"];
var dataURL=" ";
function loadScript (src) {
let scr = document.createElement ('script')
scr.src = src;
document.head.appendChild(scr)
}
function response(data, sheet){
ii=ii+1;
var fields = Object.create(null);
for (var il=0; il<data.table.rows.length; il++) {
for (var ik=0; ik<data.table.cols.length; ik++) {
if(data.table.rows[il].c[ik]!=undefined && data.table.rows[il].c[ik].v!=null ){
document.getElementById('test2').innerHTML=(sheet+" "+data.table.cols[ik].label +" __ " +data.table.rows[il].c[ik].v)
}
}
}
}
var google = {
visualization: {
Query: {
setResponse: function (data) {
try {
let e = new Error()
e.data = data;
throw e;
} catch (e) {
let nb = e.stack.indexOf('&sheet=')
if (nb>=0) {
ne = e.stack.indexOf('&', nb+7)
if (ne>=0) {
let sheet = e.stack.slice (nb+7, ne)
console.log(sheet, e.data)
response (e.data, sheet)
}
}
}
}
}
}
}
for (let im=0; im<sheetsWeNeed.length; im++) {
dataURL = "https://spreadsheets.google.com/tq?key="+idfromURL+"&sheet="+sheetsWeNeed[im]+"&headers=1";
var arrObjectsGoogle = [];
var ii=-1;
loadScript(dataURL)
}
</script>