shpasspass
V2EX  ›  问与答

一个静态html页面,输入1234后,跳转到另外一个页面,这个是怎么做的呢?

  •  
  •   shpasspass · Jun 7, 2013 · 7921 views
    This topic created in 4811 days ago, the information mentioned may be changed or developed.
    就是最简单的那种验证,访问首页,然后有一个输入框,输入1234后,才能跳转到其他页面,输错就继续输。哪位大侠给个这样的代码。
    5 replies    1970-01-01 08:00:00 +08:00
    iloahz
        1
    iloahz  
       Jun 7, 2013   ❤️ 1
    如果你不担心用户看源码而知道了答案,直接写在js里就行了。

    如果你担心,就用ajax post到服务器验证。

    都是js操作,和页面静态动态没啥关系吧
    zhttty
        2
    zhttty  
       Jun 7, 2013   ❤️ 1
    js跳转get... if... else... window.location.href...
    shpasspass
        3
    shpasspass  
    OP
       Jun 7, 2013
    @zhttty 能不能帮忙改一下这个代码http://zhidao.baidu.com/question/237453103.html
    就是如果输入错误,就提示“输错了,请重新输入”这个字样?
    0racleTink
        4
    0racleTink  
       Jun 7, 2013
    http basic authentication
    skydiver
        5
    skydiver  
       Jun 7, 2013
    @shpasspass 是window.location不是document.location

    另外写法该更新了……你这个还是xhtml1.0的,现在已经流行html5了……
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   854 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 22:29 · PVG 06:29 · LAX 15:29 · JFK 18:29
    ♥ Do have faith in what you're doing.