Get one Cell Value from Google Sheets via HTML Javascript

Hi all,
I am trying to get one specific cell from a google sheet for displaying on a website.
What i have found is a lot of examples to create a table in html from a google sheet source, but not how to get f.e. Cell "A4" only.

$.getJSON( "https://spreadsheets.google.com/feeds/cells/19weOqnGlADXwhxUUtVnfZYv2uH6UJUeSmV5WQXQ5Ccc/od6/public/values?alt=json-in-script&callback=?"
function (data) {
       //what to put in here??
});
any help appreciated
thanks in advance
OliGAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Julian HansenCommented:
Any chance we can see more code and / or returned JSON?
OliGAuthor Commented:
Julian, hi
I only have a working example which generates a list:


<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Title</title>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
</head>
<body>
      <h1>Ranking</h1>
      <div id="ranking-list"></div>
</body>
</html>
<script type="text/javascript">

$(document).ready(function() {      
//source file is https://docs.google.com/spreadsheets/d/19weOqnGlADXwhxUUtVnfZYv2uH6UJUeSmV5WQXQ5Ccc

$(function listBooks() {      
$.getJSON( "https://spreadsheets.google.com/feeds/list/19weOqnGlADXwhxUUtVnfZYv2uH6UJUeSmV5WQXQ5Ccc/od6/public/values?alt=json-in-script&callback=?",
      function (data) {      
            $('div#ranking-list').append('<ul class="items"></ul>');
            $.each(data.feed.entry, function(i,entry) {      
                  var item = '<span style="display:none">' + entry.id.$t + '</span>';      
                  item += 'erhalten: ' + entry.gsx$erhalten.$t;      
                  $('.items').append('<li>' + item + '</span></li>');      
                  });
            });
      });
});
</script>
Julian HansenCommented:
Your getJSON call URL returns
Invalid parameter value: callback=?

Open in new window


to answer the question we need to see the returned JSON as well.
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

OliGAuthor Commented:
did you just click on the hyperlink? then yes.
but if you embed the whole html code on a website, it will return a list of 14 rows.

remove the ?callback to get the raw data:
https://spreadsheets.google.com/feeds/list/19weOqnGlADXwhxUUtVnfZYv2uH6UJUeSmV5WQXQ5Ccc/od6/public/values?alt=json-in-script
Julian HansenCommented:
Do you mean something like this?
$(function listBooks() {      
  $.getJSON( "https://spreadsheets.google.com/feeds/list/19weOqnGlADXwhxUUtVnfZYv2uH6UJUeSmV5WQXQ5Ccc/od6/public/values?alt=json-in-script&callback=?",
    function (data) {   
      var a4 = data.feed.entry[3].gsx$spielername.$t;
      $('#ranking-list').html('The entry in cell A4 is : ' + a4);
  });
});

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Julian HansenCommented:
Just a comment on your jQuery. In your source you have
$(document).ready(function() {      
...
  $(function listBooks() {      
  });
});

Open in new window

$(document).ready() is the same as $(function() - so nesting one in side the other is not required - you only need the one as shown in my previous post.
OliGAuthor Commented:
exactly what I've been looking for. Thank you so much.
Julian HansenCommented:
You are most welcome.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Spreadsheets

From novice to tech pro — start learning today.