On the front-side i am recording user selections:
var type = $.cookie('liste-voyage-type');
var code= $.cookie('liste-voyage-code');
i then pass these variables to the server
$.ajax({
url: '../listing-voyage-produit.php',
type: "GET",
data : ({type: type,code :code}),
success: function(data){
alert('data:'+data);
}
});
i want to dynamically modify the variables
$type and $code
at the back end which are used for a sql request that display products on the page
i miss some elements of understanding:
alert('type:'+type); => type:2
alert('code'+code); => code:Z3\_P95\_
the success: alert('data:'+data); => data:
the callback function is triggered but the alert(data) does not display anything
how can i play with datatype, json, or eval() to make it working , converting the string variales var type and code to json and ultimately modify the variables on the server side to :
echo $type;
echo $code;
function(data){datawill be the response from server sidelisting-voyage-produit.php.