带有单引号

targetUrl('val')

<a th:onclick="'javascript:targetUrl(\''+${indexURL.value}+'\');'">

 

不带有单引号:

targetUrl(val)

<a th:onclick="'javascript:targetUrl('+${indexURL.value}+');'">

thymeleaf传值onclick到js

<div th:onclick="'javascript:themPage(\''+${theme.value}+'\',\''+${theme.type}+'\');'"></div>
 
<script type="text/javascript">
<![CDATA[
function themPage(value,type){
console.log(value+"--"+type);
}
]]>
</script>
 
thymeleaf截取:日期格式为:2017-09-10 11:22:12截取后的格式为:2017-09-10
<div class="weui-cells__tips clearfix" th:with="hdrq=${order.hdrq}">使用日期:<span th:text="${#strings.substring(hdrq,0,10)}"></span></div>
 
  <div th:if="${list.count gt '4'}">
    <i class="weui-loading"></i>
    <span class="weui-loadmore__tips">正在加载</span>
  </div>
  <div th:if="${list.count lt '4'}">
    <span class="weui-loadmore__tips">没有数据了</span>
    </div>
</div>

</div>

我这里${tmh[0].pic}是一个图片的url

thymeleaf传值onclick到js的更多相关文章

  1. thymeleaf 传参到js的onclick事件中

    html: <img th:onclick="'javascript:imgClick(\''+${card.id}+'\',\''+${card.name}+'\');'" ...

  2. iframe-父子-兄弟页面相互传值(jq和js两种方法)

    参考文章: http://blog.csdn.net/u013299635/article/details/78773207 http://www.cnblogs.com/xyicheng/archi ...

  3. 页面上使用 Thymeleaf 的内联js不当造成了 java.lang.StackOverflowError: null 问题

    由于在页面上内联js使用不当,从而在从 Controller 跳转到页面时发生了以下错误: java.lang.StackOverflowError: null at org.thymeleaf.ut ...

  4. thymeleaf的onclick标签传参异常

    转自https://my.oschina.net/u/2312080/blog/2878183 异常 严重: Servlet.service() for servlet [DispatcherServ ...

  5. 标签中的onclick调用js方法传递多个参数的解决方案

    1.JS方法 <script type="text/javascript"> funcation cc(parameter1,parameter2,parameter3 ...

  6. Spring boot+Thymeleaf+easyui集成:js创建组件页面报错

    开发工具:Ideal 使用场景:Demo 前提:       环境:Spring boot +Thymeleaf+easyui 引入thymeleaf模板引擎 <html lang=" ...

  7. a链接的onclick与js中的return false

    在学习<javascript基础教程>第八版时,有一个小细节开始不是很明白,查了一些资料后,理了一下思路. 例子的html代码: <!DOCTYPE html> <htm ...

  8. 子窗体与父窗体传值操作的js示例

    //返回值给父窗体 function returnParent(value) {//获取子窗体返回值    var parent = window.dialogArguments; //获取父页面   ...

  9. Thymeleaf 的 onclick

    th:onclick="'javascript:openBox(\''+${curCabNo}+'\',\''+${box.no}+'\')'" 真的难受 ,有没有好办法!!!!

随机推荐

  1. 【Unity】第11章 第三人称角色控制器和碰撞体

    分类:Unity.C#.VS2015 创建日期:2016-05-02 一.简介 第三人称视角控制器涉及的相关概念有: 1.刚体(Rigidbody). 2.碰撞体(Collider).包括球体碰撞体( ...

  2. password学4——Java 加密解密之消息摘要算法(MD5 SHA MAC)

    Java 加密解密之消息摘要算法(MD5 SHA MAC) 消息摘要 消息摘要(Message Digest)又称为数字摘要(Digital Digest). 它是一个唯一相应一个消息或文本的固定长度 ...

  3. /etc/sudoers 配置

    /etc/sudoers ## Allow root to run any commands anywhere root ALL=(ALL) ALL #第一个root是用户账号 第二列的ALL是登陆者 ...

  4. github pull request

    https://stackoverflow.com/questions/14680711/how-to-do-a-github-pull-request https://help.github.com ...

  5. prometheus-dashboard-to-grafana

    https://prometheus.io/docs/visualization/grafana/ https://www.digitalocean.com/community/tutorials/h ...

  6. linux命令(38):split 分割文件

    在Linux下用split进行文件分割: 模式一:指定分割后文件行数 对与txt文本文件,可以通过指定分割后文件的行数来进行文件分割. 命令: split -l 300 large_file.txt ...

  7. redis使用日志(4):如何让外部服务器访问

    开启redis 允许外网IP 访问 在 Linux 中安装了redis 服务,当在客户端通过远程连接的方式连接时,报could not connect错误. 错误的原因很简单,就是没有连接上redis ...

  8. 【教程】minicom使用教程

    简介 Linux下的Minicom的功能与Windows下的超级终端功能相似,可以通过串口控制外部的硬件设备.适于在linux通过超级终端对嵌入式设备行管理.同样也可以使用minicom对外置Mode ...

  9. 【电子基础】IIC总线工作原理

    IIC总线工作原理 I2C总线进行数据传送时,时钟信号为高电平期间,数据线上的数据必须保持稳定,只有在时钟线上的信号为低电平期间,数据线上的高电平或低电平状态才允许变化. 起始和终止信号 :SCL线为 ...

  10. js模拟form打开新窗口

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...