p1956
V2EX  ›  PHP

刷新保留输入框的字

  •  
  •   p1956 · Feb 23, 2023 · 2985 views
    This topic created in 1348 days ago, the information mentioned may be changed or developed.
    像谷歌搜索、百度搜索那样,刷新一下输入框的字还在,很多网站的搜索功能也这样,怎么实现,非 ajax
    3 replies  •  2023-02-23 22:55:27 +08:00
    FFFFourwood
    FFFFourwood
    Feb 23, 2023
    1
    刚试了下首页,打完字刷新就没了。。。。
    如果非首页的话内容已经挂在 url 上了,
    如果是首页需要保留的话,要是我的话可能会存 session storage 里吧
    vivisidea
    vivisidea
    Feb 23, 2023
    2
    p1956
    p1956
    OP
    Feb 23, 2023
    3
    搞定了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   5001 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 09:09 · PVG 17:09 · LAX 01:09 · JFK 04:09
    ♥ Do have faith in what you're doing.