当前位置:网站首页>When JS method passes long type ID value, precision loss will occur
When JS method passes long type ID value, precision loss will occur
2022-07-05 20:13:00 【Earthy taste~】
such as :onclick="test(1543401283015196673)"
The parameters passed are 1543401283015196673
, And in the js When received in the method, it will become 1543401283015196700
, The last three 673
, After rounding , Turned into 700
This pit wasted me hours , Tested repeatedly , Only to find out . Make a note of .
resolvent :
hold Long Type to string , Put quotes ;
onclick="test('1543401283015196673')"
thymeleaf Write it correctly :th:onclick="|test('${user.getId()}')|"
;
Both of the following are wrong :
th:onclick="'test('+${''+user.getId()}+')'"
th:onclick="'test('+${user.getId().toString()}+')'"
边栏推荐
- Rainbond 5.7.1 支持对接多家公有云和集群异常报警
- [C language] merge sort
- Parler de threadlocal insecurerandom
- Debezium series: record the messages parsed by debezium and the solutions after the MariaDB database deletes multiple temporary tables
- [quick start of Digital IC Verification] 7. Basic knowledge of digital circuits necessary for verification positions (including common interview questions)
- 2023年深圳市绿色低碳产业扶持计划申报指南
- Zero cloud new UI design
- JVMRandom不可设置种子|问题追溯|源码追溯
- 实操演示:产研团队如何高效构建需求工作流?
- E. Singhal and Numbers(质因数分解)
猜你喜欢
关于BRAM IP复位的优先级
Zero cloud new UI design
Leetcode brush questions: binary tree 11 (balanced binary tree)
CADD课程学习(7)-- 模拟靶点和小分子相互作用 (半柔性对接 AutoDock)
【数字IC验证快速入门】7、验证岗位中必备的数字电路基础知识(含常见面试题)
Guidelines for application of Shenzhen green and low carbon industry support plan in 2023
[quick start of Digital IC Verification] 3. Introduction to the whole process of Digital IC Design
[quick start of Digital IC Verification] 6. Quick start of questasim (taking the design and verification of full adder as an example)
js实现禁止网页缩放(Ctrl+鼠标、+、-缩放有效亲测)
Build your own website (16)
随机推荐
【数字IC验证快速入门】1、浅谈数字IC验证,了解专栏内容,明确学习目标
深度學習 卷積神經網絡(CNN)基礎
Debezium series: modify the source code to support drop foreign key if exists FK
挖财钱堂教育靠谱安全吗?
Codeforces Round #804 (Div. 2) - A, B, C
selenium 元素信息
Zero cloud new UI design
95后阿里P7晒出工资单:狠补了这个,真香...
Flume series: interceptor filtering data
基础篇——配置文件解析
Let's talk about threadlocalinsecurerandom
Leetcode skimming: binary tree 17 (construct binary tree from middle order and post order traversal sequence)
IC科普文:ECO的那些事儿
Oracle-表空间管理
关于BRAM IP复位的优先级
c語言oj得pe,ACM入門之OJ~
微信小程序正则表达式提取链接
leetcode刷题:二叉树12(二叉树的所有路径)
Leetcode: binary tree 15 (find the value in the lower left corner of the tree)
1: Citation;