V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
shpasspass
V2EX  ›  问与答

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

  •  
  •   shpasspass · 2013-06-07 11:21:52 +08:00 · 7397 次点击
    这是一个创建于 3997 天前的主题,其中的信息可能已经有所发展或是发生改变。
    就是最简单的那种验证,访问首页,然后有一个输入框,输入1234后,才能跳转到其他页面,输错就继续输。哪位大侠给个这样的代码。
    5 条回复    1970-01-01 08:00:00 +08:00
    iloahz
        1
    iloahz  
       2013-06-07 11:29:02 +08:00   ❤️ 1
    如果你不担心用户看源码而知道了答案,直接写在js里就行了。

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

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

    另外写法该更新了……你这个还是xhtml1.0的,现在已经流行html5了……
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2756 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 15:09 · PVG 23:09 · LAX 08:09 · JFK 11:09
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.