V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Dive into HTML5
http://diveintohtml5.org/
stargik
V2EX  ›  HTML

分析页面搜索引擎 提取搜索串

  •  
  •   stargik · 2015-02-07 16:37:17 +08:00 · 3592 次点击
    这是一个创建于 3358 天前的主题,其中的信息可能已经有所发展或是发生改变。

    <form action="" method="get" name="query_form" onsubmit="submit_query_form();return false" style="padding-right:135px" _lpchecked="1">
    <input type="text" name="site" id="site" class="input_02" size="40" autocomplete="off" onclick="DisplayAllSitesBox()" value="">
    像这样的是不是提取不出带问号的搜索串 method=get

    v2ex的好像不能提取 没有action
    <form onsubmit="return dispatch()" _lpchecked="1">
    <input type="text" maxlength="40" name="q" id="q" value="">

    维基百科的可以
    <form action="/w/index.php" id="searchform">
    <input type="search" name="search" placeholder="搜索" title="搜索维基百科[alt-shift-f]" accesskey="f" id="searchInput" tabindex="1" autocomplete="off">
    提取为http://zh.wikipedia.org/w/index.php?search=%s

    3 条回复    2015-02-07 17:46:40 +08:00
    aaaa007cn
        1
    aaaa007cn  
       2015-02-07 17:13:19 +08:00
    aaaa007cn
        2
    aaaa007cn  
       2015-02-07 17:31:45 +08:00
    忘说了
    如果 onsubmit 中找不到相关提交地址,或者 return false 了
    那么就用当前页面地址作为 action 的值
    http://www.w3schools.com/html/html_forms.asp
    见 The Action Attribute 这节
    aaaa007cn
        3
    aaaa007cn  
       2015-02-07 17:46:40 +08:00
    >> 如果 onsubmit 中找不到相关提交地址,或者 return false 了
    >> 那么就用当前页面地址作为 action 的值
    如果没有设置 action,并且 onsubmit 中找不到相关提交地址,onsubmit 也没有 return false
    那么就用当前页面地址作为 action 的值
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3940 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 04:13 · PVG 12:13 · LAX 21:13 · JFK 00:13
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.