开发者

store user input without mysql or php

I have a simple html application which displays 开发者_Python百科words on a click of a next button. It fetches the words from a javascript object literal file. I want to mark some of the words as easy and some as difficult. How do I save this data from browser without using a mysql database? can I edit the javascript object file directly from bowser?


If you want to take user input and store it permanently on your site, you'll have to employ some sort of server-side scripting. This doesn't have to be PHP, but it's probably the simplest way to do it. You can't use client-side javascript to write to a remote file directly.


If I understand correctly, you have JS object/array with words, you're modifying it and want to store it modified version permanently.

If so, then you can use "HTML5" localStorage.

This storage is per-browser. If you want to have single version shared between many users/browsers, then you will need some server-side support.


To save it on the client-side you could use cookies or local storage on supported browsers but this may not be the best approach if there are many words to keep track of.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜