Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
560 views
in Technique[技术] by (71.8m points)

amp html - How do I manipulate amp-notifcation local storage with amp-script

I've done a lot of reading around to try and figure out how to delete and add stuff to local storage using amp-script and amp-notification. In this case I would like to be able to add a date to the local storage and check it against current date activate the notification if the storage is a week old and delete local storage. Then let the notification acceptance reset everything.

Everything I am seeing is that amp-script requires a user interaction before it can be ran. Is that true? Based on these docs (https://amp.dev/documentation/components/amp-script/) it doesn't mention that anywhere but the samples on the page that don't require user interaction in the code don't work. Please advise. Amp notification states you should use an endpoint on the server to check the user status. That is bad. That means every page load that a cookie notification is on has to hit the server. If I have a million hits a day that doubles my server load. That is crazy. Please advise.

question from:https://stackoverflow.com/questions/65911328/how-do-i-manipulate-amp-notifcation-local-storage-with-amp-script

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...