Hi Allan, The 'if' doesn't work because you're evaluating a string (which is always true), and not the results of the query. What you need to do is fetch actual results of the cell feed. You can do that by using the alt=json-in=script response with a callback function:
// load() is @ http://gdatatips.blogspot.com/2008/07/json-in-script-loader.html load('http://spreadsheets.google.com/feeds/cells/ phdpatjjfxT7K1r1aBwitew/5/public/values/R12C2?return- empty=true&alt=json-in-script&callback=myFunc', 'spreadsheetData'); function myFunc(result) { var entry = result.entry; var value = entry.content.$t; if(value == 'SOMETHING') { // TODO: Black magic } }; Eric On Nov 19, 5:40 am, thompa <[EMAIL PROTECTED]> wrote: > Hello there, > Trying hard to learn about API's! > > I have successfully incorporated several spreadsheet pages in one web > page...... but I would like to be a little more sophisticated! > I use a Javascript routine to 'include' the Google Spreadsheets for a > number of reasons which include being able to show buttons which allow > each individual sheet to be printed. > Nt all of the sheets are used all of the time however, and I was > trying to find a way of 'testing' a sheet to see if there was an entry > in a particular cell..; if there was it would be shown on the web > page, otherwise it would not. > The sort of thing I had in mind was:- > > if ('http://spreadsheets.google.com/feeds/cells/ > phdpatjjfxT7K1r1aBwitew/5/public/values/r12c2/return-empty ) > { > document.write("<div class='print' align='center'>") > document.write("<!-- Start of input from Google Spreadsheet -->") > document.write("<iframe src='http://spreadsheets.google.com/pub? > key=phdpatjjfxT7K1r1aBwitew&output=html&gid=31&single=true&range=b2:x26' > name='Google Docs - League 5C' width='1010' height='475' > align='middle' scrolling='yes'></iframe>") > document.write("<!-- End of input from Google Spreadsheet -->") > document.write("</div>") > etc. > } > > Unfortunately the 'if' statement doesn't work! > > Has anyone done this.. is there another way... or is my code > incorrect? > > thanks in anticipation > > Allan Thompson --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Docs Data APIs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Docs-Data-APIs?hl=en -~----------~----~----~----~------~----~------~--~---
