UserName is a global variable that i set in an another html file :
function Login(){
var log = $("#login").val();
var mdp = $("#mdp").val();
var sended = {
url: '{{.LoginUrl}}',
type: 'POST',
data: {'\"log\"': log, '\"mdp\"': mdp},
success: function(data){
if(data.Success){
UserName = data.UserName;
window.location.replace(data.Url);
}
else{
alert(data.Err);
}
}
};
$.ajax(sended);
}
I've check the data returned and my UserName is ok with the json return so must be the assignation.
But when i do the redirection UserName go back to "" and i can't use it.
Is it because the layout is reloaded every time i have a navigation?
Thanks for reading and i hope you can help me.
Hi, I've got some javascript in my layout.html :
UserName is a global variable that i set in an another html file :
I've check the data returned and my UserName is ok with the json return so must be the assignation. But when i do the redirection UserName go back to "" and i can't use it. Is it because the layout is reloaded every time i have a navigation? Thanks for reading and i hope you can help me.