带有单引号

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. Hbase/Hadoop Java API编程常用语句

    从scanner获取rowkey: for(Result rr : scanner){ String key =Bytes.toString(rr.getRow())} HBase API - Res ...

  2. processing fill()和stroke()函数

    在procesiing有两个基本的函数,fill()和stroke()函数,这两个函数分别用来控制形状填充颜色和形状轮廓的颜色,fill()和stroke()可以接受的参数的个数为1,2,3.当参数的 ...

  3. Java数据结构和算法(十):二叉树

    一.简介 二叉树是树这种数据结构的一员,后面我们还会介绍红黑树,2-3-4树等数据结构.那么为什么要使用树?它有什么优点? 前面我们介绍数组的数据结构,我们知道对于有序数组,查找很快,并介绍可以通过二 ...

  4. Oracle 11G 安装图文教程

    Oracle 11G 下载地址:http://www.oracle.com/technetwork/cn/database/enterprise-edition/downloads/index.htm ...

  5. Atitit opencv 模板匹配

    Atitit opencv 模板匹配 1.1. 图片1 1.2. Atitit opencv 模板匹配  6中匹配算法貌似效果区别不大1 1.3. 对模板缩放的影响 一般的缩放可以,太大了就歇菜了.. ...

  6. 深入理解Linux内核-页高速缓存

    页高速缓存:1.磁盘高速缓存的一种 2.一种对完整的数据页进行操作的磁盘高速缓存.3.将一页数据写到块设备的时候,内核首先检查对应的页是否已经在高速缓存中,不在就添加并填充数据.4.I\O数据的传送并 ...

  7. 深入理解Linux内核-内存寻址

    1.逻辑地址怎么转换为线性地址的: 逻辑地址 = 段选择符(16bit)+偏移量(32bit) 段选择符又三部分组成:index(索引序号).T1(表指示器).RPL(request privileg ...

  8. 隐藏Tengine的版本信息

    http { ..... server_tokens on; server_info on; server_tag bass; reset_timedout_connection on; keepal ...

  9. c#,asp.net 开发 app 学习资料整理

    VS2015 Apache Cordova第一个Android和IOS应用 http://www.cnblogs.com/aehyok/p/4116410.html PhoneGap:免费开源的 HT ...

  10. Erlang中一些错误或者异常的标识

    erlang中错误大体分为四种: 1. 编译错误    2. 逻辑错误    3. 运行时错误    4. 用户代码生成的错误 编译错误,主要是编译器检测出的代码语法错误 逻辑错误,是指程序没有完成预 ...