I am working on a very simple Vapor application. I am currently working on one of the following:
#extend("base")
#export("body") {
<form>
<div class="row">
<div class="six columns">
<label for="exampleEmailInput">Acronym</label>
<input class="u-full-width" type="email" id="short">
</div>
<div class="six columns">
<label for="exampleRecipientInput">Long form</label>
<input class="u-full-width" type="email" id="long">
</div>
</div>
</form>
<div class="row">
<div class="five columns"></div>
<div class="two columns">
<a class="button button-primary" id="submit" href="/acronym/all">Save Acronym</a>
</div>
<div class="five columns"></div>
</div>
<script>
function setHref() {
var short = $("#short").val();
}
</script>
}
This code works until I add a variable shortto the function setHref. Then I get a parsing error:
Uncaught Error: ParseError.tagTemplateNotFound("short\").val"). Use middleware to catch this error and provide a better response. Otherwise, a 500 error page will be returned in the production environment.
Why is this happening?
source
share