I have a variable of this type:
- var route = "/app/imagenes/"+location.href.split("/")[location.href.split("/").length - 2];
which generates the following error:
Can not read property 'href' of undefined
but when I put it in a script.
it's fully functional
script.
var route = "/app/imagenes/"+location.href.split("/")[location.href.split("/").length - 2];
The problem is that it is impossible for me to pass the variable to form
when the variable is inside the script. since Jade/Pug
forces me to pass the variables with a " -
"
form(action=route method="POST" enctype="multipart/form-data" class="col-md-6 remove-float center-block big-top-space")
I need to be able to access that variable from the form action and I have not found any way with Jade/pug
script.
var route = "/app/imagenes/"+location.href.split("/")[location.href.split("/").length - 2];
form(action=route method="POST" enctype="multipart/form-data" class="col-md-6 remove-float center-block big-top-space")
in advance thank you very much for your help