Why won't my very simple stack work in HTML5?

Bringing your stacks to the web

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

mbossiere
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 40
Joined: Wed Aug 01, 2007 2:15 am

Re: Why won't my very simple stack work in HTML5?

Post by mbossiere » Mon Feb 05, 2024 6:46 am

SWEdeAndy wrote:
Sun Feb 04, 2024 9:25 pm

Accessing the clipboard data should be simpler, one would assume, but that seems to be a tricky business as well. Theoretically, using navigator.clipboard.readText should do it, but there are user permission issues to overcome first. I have spent some time searching for solutions in various web/javascript forums, but I have not yet had any success in getting a LC stack to do it. I'll look into it again another day, as I too would like to find a method to do this.
Yes, I suspected this was likely. I am not that familiar with how browsers operate but I know OS's and end users must give permissions. How do "cookies" work in general? They are given user permission in most cases and I wonder if the parameters of a cookie would allow them to store user input and/or simple interactive data? This may be a dumb question, but I could imagine so many possibilities if some rudimentary data could be locally associated with an app, even if highly restrictive.

mbossiere
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 40
Joined: Wed Aug 01, 2007 2:15 am

Re: Why won't my very simple stack work in HTML5?

Post by mbossiere » Mon Feb 05, 2024 7:03 am

By the way, things are significantly more interesting since adopting LC 10 dp (as suggested by SWEdeAndy). The function that would not respond now works from the script stack when called by my btn, and "answer.." works as well.
My latest iteration is usable:
https://wildcard.on-rev.com/my/24-02.04 ... yDate.html
Why, though, do "answer" dialogs include a prelude, such as "wildcard.on-rev.com says..."
This is unrequested and ugly, if nothing else!
Attachments
Screen Shot 2024-02-04 at 10.55.54 PM.png

SWEdeAndy
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 250
Joined: Sat Aug 16, 2008 9:48 am
Location: Stockholm, Sweden
Contact:

Re: Why won't my very simple stack work in HTML5?

Post by SWEdeAndy » Fri Feb 09, 2024 8:26 pm

mbossiere wrote:
Mon Feb 05, 2024 6:46 am
I could imagine so many possibilities if some rudimentary data could be locally associated with an app, even if highly restrictive.
And here we can strike a happier note: Local storage will be your friend! There is a thorough blog post on this by LC staff:
https://livecode.com/storing-user-data-on-the-web/

"The LocalStorage object is one of the most widely used objects in web programming as it provides a simple solution for storing key-value pairs locally on a user’s computer with no expiration date.These values can be strings, numbers, booleans, or even objects. Here, stored data will remain available even when you close the browser or tab."
Andreas Bergendal
Independent app and system developer
WhenInSpace: https://wheninspace.se

mbossiere
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 40
Joined: Wed Aug 01, 2007 2:15 am

Re: Why won't my very simple stack work in HTML5?

Post by mbossiere » Sun Feb 11, 2024 5:59 am

SWEdeAndy wrote:
Fri Feb 09, 2024 8:26 pm
mbossiere wrote:
Mon Feb 05, 2024 6:46 am
I could imagine so many possibilities if some rudimentary data could be locally associated with an app, even if highly restrictive.
And here we can strike a happier note: Local storage will be your friend! There is a thorough blog post on this by LC staff:
https://livecode.com/storing-user-data-on-the-web/

"The LocalStorage object is one of the most widely used objects in web programming as it provides a simple solution for storing key-value pairs locally on a user’s computer with no expiration date.These values can be strings, numbers, booleans, or even objects. Here, stored data will remain available even when you close the browser or tab."
A happier note indeed! This is a revelation for me. Very excited to explore the LocalStorage object further - thanks for this valuable link Andreas!

Post Reply

Return to “HTML5”