Skip to content Skip to sidebar Skip to footer

Passing Value From One Html To Another Html Using Post Method

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 javascri

Solution 1:

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


Solution 2:

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

Solution 3:

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.


Post a Comment for "Passing Value From One Html To Another Html Using Post Method"