简体   繁体   English

如何动态地将数据附加到没有ajax或输入标签的表单发布中

[英]how to dynamically append data to form post without ajax OR input tags

I am analyzing header tags for submitting forms online in order to better understand how htmlhttp forms work- signing in to gmail, yahoo mail, and amazon, using the network tab of google developer tools, to view the http headers of requests and responses, and learn where they come from. 我正在分析用于在线提交表单的标头标签,以便更好地了解htmlhttp表单如何使用gmail,yahoo mail和amazon登录到Google开发者工具的网络标签,以查看请求和响应的http标头,以及了解他们来自哪里。 I am seeing very peculiar behavior in my browser's (chrome)request headers when signing into amazon. 登录到亚马逊时,我在浏览器的(chrome)请求标头中看到了非常特殊的行为。 The form data, always has the following two header names appended to the second and third to last places of the form data query: x=(some random number), and y=(some random number). 表单数据始终在表单数据查询的第二个和最后一个末尾附加以下两个标头名称:x =(某个随机数)和y =(某个随机数)。

There are no input tags getting dynamically generated, since when i step through the code using breakpoints, none ever get added, and when i tell google chrome to break on all subtree modifications, the site still sends off the post with the added parameters before anything gets modified. 没有输入标签会动态生成,因为当我使用断点逐步执行代码时,一无所获,并且当我告诉谷歌chrome中断所有子树修改时,该站点仍会先发送带有添加参数的帖子被修改。

There also is NO ajax call which is causing dynamically added data to be appended to the form post, since google developer tools shows no ajax comes before the form post in the timeline of the network tab. 也没有ajax调用,它导致将动态添加的数据附加到表单发布中,因为google开发人员工具显示在网络标签的时间轴中,没有任何ajax出现在表单发布之前。

My question is this: is there any way, using javascript, to instruct a browser, to append data to a form post, WITHOUT the use of dynamically appended input elements, or ajax? 我的问题是:有没有办法使用javascript 来指示浏览器,将数据附加到表单后,而无需使用动态附加的输入元素或ajax?

If you are talking about the x & y variables specifically, then it came from an <input type="image"> . 如果要专门讨论xy变量,则它来自<input type="image"> You could try playing with input type image and see how it behaves. 您可以尝试使用输入类型的图像并查看其行为。

But for other cases (where you want to add any other variable) then I think the best way is to append input elements on the fly. 但是对于其他情况(要添加任何其他变量),我认为最好的方法是动态添加输入元素。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM