JavaScript that permanently changes server css

0

First, I apologize if this question is too vague or stupid, but I really do not know enough to formulate otherwise.

My idea is simple, create a site where, through JavaScript, the visitor can, for example, drag and change the position of an element on the screen. But that this new position that the element assumed is permanent, including for the next page visitors, not just the client side. I imagine then a script that changes placement parameters in a css file on the server permanently.

Is it possible to do this with just JavaScript? I imagine it is not possible for JavaScript to be a client-side language. What other direction can I take then?

    
asked by anonymous 25.06.2016 / 20:38

1 answer

0

The two main possibilities are:

  • Create events in JavaScript where, after a user makes a change, he / she makes an AJAX request, saving the values on the server as you see fit. These values are restored when the page is loaded again.

  • If changes do not necessarily have to last a lifetime, you can use localStorage to save the data in the browser and read whenever you need it. However, data will be lost if the user clears, switches browsers, and so on.

  • 08.07.2016 / 06:46