使用POST方法从一个HTML传递价值的另一个HTML [英] Passing value from one html to another html using post method

查看:172
本文介绍了使用POST方法从一个HTML传递价值的另一个HTML的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想通过从一个HTML两个值(参数)到另一个HTML而不网址显示的值(即同样喜欢交法)。 如何获得使用JavaScript或AJAX或jQuery的第二个HTML的价值。

i want to pass two values(parameters) from one html to another html without displaying the values in url(i.e same like post method). How to get the value in 2nd html using javascript or ajax or jquery .

例如:

client.html

client.html

<html>
<body>

<form id="Form1" action="http://xyz/plus/server.html" method="post">
<table width="40%">
    <tr><td>Country:</td><td><input type="text" name="country" id="country" />  </td></tr>
    <tr><td>Language:</td><td><input type="text" name="lang" id="lang" /></td></tr>
    <tr><td align="center"><input type="submit" /></td></tr>
</table>
</form>

</body>
</html>

server.html

server.html

<script>?? </script> 

如何开始使用JavaScript或AJAX或jQuery的在server.html文件数据。 plz帮助我.... 在此先感谢

how to get data in server.html file using javascript or ajax or jquery . plz help me.... Thanks in advance

推荐答案

如果您不希望从URL传递值,您可以propabally使用JavaScript cookies来传递的价值观。或youy将被要求使用AJ​​AX POST方法来requried值传递给下一个HTML 这里是$ C $下的ajax post方法调用

if you would not like to pass values from URL, you can propabally use the javascript cookies to pass the values. or youy will be required to use ajax post method to pass requried values to next html here is the code for ajax post method call

$.ajax({
type: "POST",
url: url,
data: data,
success: success,
dataType: dataType
});

这篇关于使用POST方法从一个HTML传递价值的另一个HTML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆