404 ERROR when I try to GET data from google spreadsheet

Vitiello Andrea

Hy everyone, I don't know if exit someone who can help me.

I don't know how it is possible, few days ago all ok now it stop to work. Basically I read data in a html table on a website from a google spreadsheet public on website and public to everyone with the link. Using ajax.

Until now it worked, i saw all the datas and voices presents on my sheet in google drive, now it stop to show the datas and return an anonymous error like if the link to my google spreadsheet is inexistent, but it is here!!

For example on this googlesheet: https://docs.google.com/spreadsheets/d/13KmAf2uc13fWxPvn8dtk9j9kOL3nCVqi8H-wYau6Tww/edit?usp=sharing

I Have a series of data to display on my html website. Until few days ago it worked, now no.

I used jquery google : src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.0/jquery.min.js">

I public my code below:

<script>
$.getJSON("https://spreadsheets.google.com/feeds/list/13KmAf2uc13fWxPvn8dtk9j9kOL3nCVqi8H-wYau6Tww/od6/public/values?alt=json", function (data) {
  var sheetData = data.feed.entry;
  var i;
  for (i = 0; i < sheetData.length; i++) {
    var nome = data.feed.entry[i]['gsx$_cn6ca']['$t'];
    var ingredienti = data.feed.entry[i]['gsx$_cokwr']['$t'];
    var prezzo = data.feed.entry[i]['gsx$_cpzh4']['$t'];
    document.getElementById('Vinorosato').innerHTML += ('<div class="Teglie menu-restaurant">'+'<span class="clearfix">'+'<a class="menu-title" style="padding-right: 50px;">'+nome+'</a>'+'<span class="menu-price">'+prezzo+'</span>'+'</span>'+'<span class="menu-subtitle" style="padding-right: 100px;">'+ingredienti+'</span>'+'</div>');
  }
});

enter image description here

Mike Steelson

Try this code that doesn't require jQuery

<html><body>
<script>

function reqListener () {
  var jsonString = this.responseText.match(/(?<="table":).*(?=}\);)/g)[0];
  var json = JSON.parse(jsonString);
  var table = '<table>'
  for (var i=0;i<json.rows.length;i++){
    var nome = json.rows[i].c[0].v;
    var ingredienti = json.rows[i].c[1].v;
    var prezzo = json.rows[i].c[2].v;
    table += '<tr><td>' + nome + '</td><td>' + ingredienti + '</td><td>' + prezzo + '&nbsp;&euro;</td></tr>'
  }
  table += '</table>'
  document.getElementById("Vinorosato").innerHTML = table;
}

var id = '13KmAf2uc13fWxPvn8dtk9j9kOL3nCVqi8H-wYau6Tww';
var gid = '0';
var url = 'https://docs.google.com/spreadsheets/d/'+id+'/gviz/tq?tqx=out:json&tq&gid='+gid;
var oReq = new XMLHttpRequest();
oReq.onload = reqListener;
oReq.open("get", url, true);
oReq.send();
 
</script>
<div id="Vinorosato">&nbsp;</div></body></html>

and adapt with your own style

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

I get 404 error when I try endpoint on localhost

I am using @PathVariable from springframework. When I try to return view page name from controller, I get 404 error

When i try to get data from data for edit page it's showing me error

When I try to send data from one table to another, I get an error

Jmeter : Error when I try to get data from Database using beanshell assertion

KOTLIN/FIREBASE Error when I try get data from firebase database - Client is offline

Getting an error when I try to parse data to get values from JSON

I try to get a football game schedule from Google and this error occurs

404 Error when trying to get the photos from Google Map API

error when try to get data from json angular

ViewModel return clear object when i try to get data from it

Project freezes when I try to get data from api

I get this error when I try to install

error when I try to fill table with data

I get a syntax error when I try to use array map function in Google Scripts. Why?

Can't get data from API on my Google Spreadsheet

Get data from a lot of different sheets with a script in Google Spreadsheet

Why do I get this error in my logcat when I try to post JSON data?

I'm trying to make a simple app in flutter that fetches data from an API. However when I try running the code I get the following error

I got error when I tried to get data from server

I get an error when I pull data from the internet

Get values from google spreadsheet

Why do I get 'undefined' error when I try to read session atrribute from Controller

why i get "no attirubute error" when i try to call python function from c++

Why do I get an error (Notice: Undefined index) when I try to echo a value from my database?

Why am I getting an error when I try to get a string from my table in a Jframe?

I get an error when I try to retrieve the results from a php_mysql query.

Why do I get an Error when I try to rename a table after FROM?

Google Spreadsheet: Table From Data