JavaScript display new page when submit HTML form

前端 未结 4 1793
庸人自扰
庸人自扰 2021-01-07 14:02

Suppose I have 2 html files: form.html and confirm.html

form.html just have a text field and a submit button, when you hit submit it will display what you just typed

4条回答
  •  南方客
    南方客 (楼主)
    2021-01-07 14:42

    Seams like a fit for persist.js, which will let you save and load data in the user's browser. After including its javascript file, you can save data like this:

    var store = new Persist.Store('My Application');
    store.set('some_key', 'this is a bunch of persistent data');
    

    And you can later retrieve the saved data in another html page like the following:

    var store = new Persist.Store('My Application');
    val = store.get('some_key');
    

提交回复
热议问题