Passing value from one html to another html using post method [duplicate]

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 .

example :

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

<script>?? </script> 

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

Answers:

Answer

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
});
Answer

Your question is not very much clear. but what i understood from your question is that you want something like below using jQuery

Write this in page1.html

$.ajax({
    url:"page2.html?parm1=v1&p2=v2",
    type:"POST"
    success:function(){
    },
    error:function(){
    },
 });

To read the parameter in page2.html follow this

Answer

If you aren't using any scripting language than all you can do is use a container . Load new html's in a container say - iframe and save the data globally.

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.