简体   繁体   中英

Saving data using Jquery or Javascript

Is there any way to save variables using Jquery or javascript, besides setlocalstorage? For example: I have a product catalog website online. I made administration rights features like a window where you can add the name, picture and price of an item. That item data goes into the array using push(). But it only works locally. I want the items I add to be seen by anyone who visits my website.

var products=[["fishing rod"," https://i.pinimg.com/originals/d1/1c/41/d11c419d0c75307b18e388a0c2d64907.jpg ",10.99],["fishing line"," https://s7d2.scene7.com/is/image/dkscdn/15SFXUSFXSG330YD6FLI_Clear_is/ ",3.99]];

I have 3 inputs on my window, 1 for name, 1 for img src and the last one for the price. When I click 'OK' it pushes that new array into my products array. But I want to save that array inside the folder of my online website. So that more people with admin rights can add more products and that I can see the changes online. I hope I made myself clear.

You should use a backend that store this data in some kind of database (SQL or nosql).

Then you access it a display the content to all the users.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM