spring boot:使用Thymeleaf+Amaze UI出现的未知BUG
来源:互联网 发布:java之父有多牛 编辑:程序博客网 时间:2024/05/19 16:49
功能描述:使用<button>的onclick事件触发js来提交表单
<input type="button" value="编辑" class="am-btn am-btn-default am-btn-xs am-text-secondary" th:onclick="'EditMenu(\''+${menu.menuId}+'\');'"/><script th:inline="javascript">/*<![CDATA[*/ function EditMenu(menuId){var src = contextPath + "admin/editmenu?menuId="+menuId; window.location.href=src;/*用button标签时这个跳不了 *//* window.open(src); button标签这个可以跳 */}/*]]>*/</script>
症状:
尝试1:成功调用js,在执行window.location.href=src前后都能在控制台输出语句,唯独window.location.href=src不能跳转
尝试2:将window.location.href=src的地址改为https://www.baidu.com/亦不能跳转
尝试3:将window.location.href=src改为window.open(src)成功在新页面打开
尝试4:抛弃button按钮,使用input按钮,window.location.href=src成功跳转
未知:为何使用button标签时js里的location会无效?
阅读全文
0 0
- spring boot:使用Thymeleaf+Amaze UI出现的未知BUG
- amaze ui 的使用
- spring boot thymeleaf的使用
- Spring Boot使用Thymeleaf
- spring-boot-web-ui及thymeleaf基本使用
- Spring Boot (三):Thymeleaf 的使用
- spring-boot--使用thymeleaf模板
- spring-boot--使用thymeleaf模板
- Spring Boot使用thymeleaf模板
- spring-boot--使用thymeleaf模板
- spring-boot--使用thymeleaf模板
- spring boot使用thymeleaf模板
- spring-boot--使用thymeleaf模板
- Spring Boot 使用 Thymeleaf模板
- spring-boot--使用thymeleaf模板
- Spring boot使用thymeleaf模板
- Spring boot 中使用 Thymeleaf
- Spring Boot—— Thymeleaf (gradle) 的简单使用
- LESS CSS 框架简介
- 趣味编程算法类文章征集列表
- EditText 取消多余的内边距
- PHP常量
- WebView的加载
- spring boot:使用Thymeleaf+Amaze UI出现的未知BUG
- 在Java程序中使用系统环境变量
- 论文综述资料
- debian 桌面安装
- 盘点国内外2017年上半年网络安全事件
- hadoop-2.7.4-翻译文档-viewFS指南
- 深度学习的这些坑你都遇到过吗?神经网络11大常见陷阱及应对方
- python数据结构之直接插入排序
- traincascade's error (Required leaf false alarm rate achieved. Branch training terminated.)