在使用Chrome开发工具提交表单期间,如何检查标记的值? [英] How can I inspect the values of tags during the submit of a form using Chrome Dev Tools?
问题描述
在页面处于休眠"状态期间,我可以通过在Chrome开发工具的控制台标签中输入标签的ID来检查任何标签的值,例如,标记为"BeginDate"的标签:
During a page's "dormant" state, I can inspect the values of any tag by entering its id in Chrome Dev Tools' console tab, like so, e.g. for a tag with the name "BeginDate":
0)在控制台标签中输入"BeginDate" 1)密钥化
0) Enter "BeginDate" in the console tab 1) Mash the key
...我看到了整个爆炸:
...and I see the whole shebang:
<input alt="date-us" data-val="true" data-val-regex="End Date must be in the format &quot;m/d/yyyy&quot;" data-val-regex-pattern="[0-9]*[0-9]/[0-9]*[0-9]/[0-9]{4}" data-val-required="End Date must be in the format &quot;m/d/yyyy&quot;" id="EndDate" name="EndDate" style="width: 164px;" type="text" value="5/14/2013" class="hasDatepicker">
因此它显示的值是今天的日期,这是我感兴趣的部分.
So it shows the value, which is the part I'm interested in, is today's date.
不过,我要检查的只是按下表单的提交"按钮时正在传递/发布的内容.我相信这将是asp.net中Request对象的内容,但是如何使用Chrome Dev Tools看到这些val?
What I want to inspect, though, is just what is being passed/posted when the form's Submit button is pressed; I believe this would be, in asp.net, the contents of the Request object, but how can I see these vals using Chrome Dev Tools?
我在控制台中单击鼠标右键,然后选择记录XMLHTTPRequests"和在导航时保留日志",但是...它们被记录了吗?如果是这样,它们在哪里?我在控制台"选项卡中什么都看不到...
I right-clicked in the console and selected "Log XMLHTTPRequests" and "Preserve log upon navigation" but...are they logged? If so, where are they? I see nothing in the Console tab...
多亏了大卫·齐曼(David Ziemann),这是我所看到的:
Thanks to David Ziemann, here's what I see:
推荐答案
网络"选项卡将显示任何网络通信.在其中,您可以选择请求并查看应包含表单数据的标题.
The Network tab will show you any network communication. Within that you can select the request and view the headers which should include the form data.
这篇关于在使用Chrome开发工具提交表单期间,如何检查标记的值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!