I am testing warning messages on my website, I am collecting values passed through the session and showing them in an alert.
In this first part I get the values, check it and pick it up perfectly
<%
String registro= (String)session.getAttribute("registro");
String permisos= (String)session.getAttribute("permisos");
Integer estado= (Integer)session.getAttribute("estado");
String nombre= (String)session.getAttribute("nombre");
String clave=(String)session.getAttribute("clave");
%>
Now with this code I have the message displayed as soon as the page is loaded
<body class="hold-transition skin-black sidebar-mini" style="height: auto;
min-height: 100%; overflow-y:auto; " onload="permisosMenu()">
Here the javascript code is quite simple
<script >
//esto es JavaScript
function permisosMenu() {
var cadena = <%=permisos%>;
alert(cadena);
}
</script>
And when I run it shows me this message (which is correct)
THE PROBLEM
When I try to pass another value that is not that variable, such as the "registry"
<script >
//esto es JavaScript
function permisosMenu() {
var cadena = <%=registro%>;
alert(cadena);
}
</script>
I get the following error by console (Be careful if you get the value of the registry that would be "admin", but do not boot it by the alert)
Does anyone know what my mistake is?