Tuesday, 15 July 2014

string - Store very small amount of data with javascript -



string - Store very small amount of data with javascript -

i have 1 of websites gives yes or no response question posed url. illustration beingness http://isnatesilverawitch.com.

my site more of in-joke , reply changes frequently. able store short 1 or 2 word string , able alter without editing source on site if possible using javascript. don't want set entire database hold single string.

is there way write file without much trouble, or perchance web service designed retrieve , alter single string utilize powerfulness such site? know it's unusual question, people in office kick out of it. considering building mobile app manipulate reply on fly.

additional: clear want alter value of single string can't utilize random answer. without beingness specific, think of site states if doc in or out, don't want spit out random answer, needs in when in , out when out. alter value manually, create process simple , can on mobile device. can't edit source (nor want to) phone.

since don't want have server-side code or database, 1 alternative have javascript retrieve values google spreadsheet. tabletop (http://builtbybalance.com/tabletop/) 1 library designed allow this. create public google spreadsheet , enable "publish web", gives public url. here's simplified version of code you'd utilize on site:

function init() { tabletop.init( { url: your_public_spreadshseet_url, callback: function (data) { console.log(data); }, simplesheet: true } ) }

javascript string

No comments:

Post a Comment