javascript - 如何查看提交表单的 url 输出?

标签 javascript jquery forms

有一个网站,我想创建可以自动执行登录过程的链接地址。

从登录页面源代码中,我了解到它会在表单中使用post方法提交id、passwd值。

但我想知道此表单提交导致的整个“url”地址。我的意思是,最终它会传递 id、passwd 值,如“somewebpage?id=someid&passwd=somepw”,对吗? (当然会通过表单用encodeURIComponent进行处理)

这个包含 url 地址的参数就是我正在寻找的,因为我想如果我知道这一点,那么我就可以自动化登录过程。

但是,该地址并未明确显示(甚至短暂显示)。有没有办法以某种方式“alert()”这个网址地址或通过 chrome 开发者工具或其他东西查看它?

顺便说一句,这是登录页面示例:

<form id="login" name="login" class="login" method="post"
      action="" enctype="application/x-www-form-urlencoded"
      style="background-image: url(../main/image/index.gif)">
<input type="hidden" name="url" value="../main/index.cgi" />

<table class="login-form">
<tr>
  <td>
    <table>
    <tr>
      <td class="label"><label for="login_id">ID</label></td>
      <td class="input">
      <input type="text" id="login_id" name="id" value="" onclick="select();" maxlength="8"/>
    </td>
    </tr> 
    <tr>
      <td class="label"><label for="login_passwd">Passwd</label></td>
      <td class="input">
      <input type="password" id="login_passwd" name="passwd" value="" onclick="select();" maxlength="8"/> 
      </td>
    </tr>
    </table>
  </td>
  <td>
  <input type="submit" id="login_submit" value="Go" />
  </td>
</tr>
<tr>

</tr>
</table>
</form>

最佳答案

您应该能够在 firebug net 面板中看到 POST url。

关于javascript - 如何查看提交表单的 url 输出?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28468772/

相关文章:

jquery - 通过在页面加载时为 div 着色来突出显示(不使用 jQuery UI)

php - 将表单输入附加到 Formdata 对象不起作用

javascript - 了解归并排序中具有返回值的递归

javascript - Knockout JS 绑定(bind)不使用简单 View 模型输出值

javascript - svg动画逐个字母填充vivus.js

jquery - 如何从fabricjs Canvas 中删除事件监听器

javascript - 如何在双引号字符串内添加变量

jquery - 如何在移动设备上禁用(而不是隐藏)BxSlider

php - 使用 MySQL 将多个表单的数据插入到多个表中

javascript - 销毁记录前的额外 "Are you sure?"