I have a js file that contains this function:
function Relleno(variable){
if(variable!=""){
return true
}
else{
return false;
}
}
Then I have a JSP where I use this function in my Jquery
<script src="../js/funciones.js"></script>
<script
src="https://code.jquery.com/jquery-3.3.1.js"
integrity="sha256-2Kok7MbOyxpgUVvAk/HJ2jigOSYS2auK4Pfzbm7uH60="
crossorigin="anonymous">
</script>
<script>
$(document).ready(function(){
var nombre = "";
if(Relleno(nombre)){
alert("Esta relleno");
}
else{
alert("Vacio");
}
</script>
And when I try it, I do not get any alerts. The route seems to me to be fine. I call functions.js from Productos.jsp, attached image.
Thank you very much in advance.