javascript - 从 javascript 代码提交到 spring Controller

标签 javascript java html spring

我正在尝试从 JavaScript 向 Controller 提交表单,但表单按钮未显示。

这是我的尝试

 for (var i = 0; i < json.length; i++) {
                        users += '<strong>' + json[i].email + '</strong><br/>'  + '<br/>' + json[i].tok + '<hr><br/>';


                        //trying to hit to the controller from here but it is not working
                        //trying to hit to the controller from here but it is not working
                '<form method="post" action="searchAdmin" novalidate="novalidate">'
                '<input type="email" value="json[i].email" name="searchName" id="searchName"/>'
                 //on clicking the fetch button let it submit to the controller
                 '<input type="submit" value="FETCH" />'
                 '</form>'

请帮忙!

最佳答案

user+='<form met....  

因为您在第一行使用了 ;,所以您需要附加此字符串

关于javascript - 从 javascript 代码提交到 spring Controller ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39656271/

相关文章:

javascript - jQuery 如何隐藏表中包含 td 的所有跨度

javascript - 无法使用Javascript/JQuery更改视频静音属性

java - 如何检查文件 "mm"是否以大写形式存在,如 linux 中的 "mM"或 "Mm"

javascript - 为什么这段代码没有加载ajax jquery页面

java - Windows 上的 Solr 6 在创建新集合时失败

java - 如何在JOOQ中通过复合主键选择多行?

html - 如何在每行中放置相同数量的 div?

javascript - 使用 JavaScript 查找 HTML 元素的 X/Y

javascript - AngularJS 1.6 中的方法多态/继承

javascript - 将动态值插入对象数组,javascript