Reputation: 2446
I have a page where I generate a javascript Array and I want to send it to the berechnungsauswertung.php
page and load that page. And than I want to use the data at this page in php.
$.ajax({
type : 'post',
url : 'berechnungsauswertung.php',
data : {
marker : JSON.stringify(data),
homemarker : JSON.stringify(datahome)
},
complete : function(data){
$('body').load( "berechnungsauswertung.php" );
}
});
on the next page I want to get the Variables
$marker = json_decode($_POST['marker']);
$homemarker = json_decode($_POST['homemarker']);
but it does not work. How can I load a Page like this?
Upvotes: 0
Views: 115
Reputation: 943220
This is what you are doing:
It doesn't work because you don't have the data from 1 when you are loading the new content in 4.
Replace your complete
function with a success
function. Do something with the data you get (the first argument to the success function) such as passing it to jQuery('something').html(data)
.
Don't use load
at all.
Upvotes: 1