当前位置:网站首页>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()}+')'"
边栏推荐
- 浅浅的谈一下ThreadLocalInsecureRandom
- Go language | 01 wsl+vscode environment construction pit avoidance Guide
- Leetcode skimming: binary tree 16 (path sum)
- Leetcode brush questions: binary tree 11 (balanced binary tree)
- Build your own website (16)
- 【数字IC验证快速入门】1、浅谈数字IC验证,了解专栏内容,明确学习目标
- 股票开户哪里好?网上客户经理开户安全吗
- 强化学习-学习笔记4 | Actor-Critic
- CADD课程学习(7)-- 模拟靶点和小分子相互作用 (半柔性对接 AutoDock)
- ffplay文档[通俗易懂]
猜你喜欢

JS implementation prohibits web page zooming (ctrl+ mouse, +, - zooming effective pro test)

618 "low key" curtain call, how can baiqiushangmei join hands with the brand to cross the "uncertain era"?

Leetcode brush questions: binary tree 18 (largest binary tree)

kubernetes资源对象介绍及常用命令(五)-(ConfigMap&Secret)

How to select the Block Editor? Impression notes verse, notation, flowus

A way to calculate LNX

Solve the problem that the database configuration information under the ThinkPHP framework application directory is still connected by default after modification

Parler de threadlocal insecurerandom

Oracle tablespace management

Interviewer: what is the internal implementation of set data types in redis?
随机推荐
Unity editor extended UI control
【数字IC验证快速入门】6、Questasim 快速上手使用(以全加器设计与验证为例)
A solution to PHP's inability to convert strings into JSON
Some problems encountered in cocos2d-x project summary
Debezium series: PostgreSQL loads the correct last submission LSN from the offset
Notes on key vocabulary in the English original of the biography of jobs (12) [chapter ten & eleven]
Parler de threadlocal insecurerandom
Oracle-表空间管理
Leetcode brush question: binary tree 14 (sum of left leaves)
【数字IC验证快速入门】3、数字IC设计全流程介绍
Thread pool parameters and reasonable settings
model方法
IC科普文:ECO的那些事儿
信息学奥赛一本通 1338:【例3-3】医院设置 | 洛谷 P1364 医院设置
Hong Kong stocks will welcome the "best ten yuan store". Can famous creative products break through through the IPO?
Reinforcement learning - learning notes 4 | actor critical
leetcode刷题:二叉树12(二叉树的所有路径)
Leetcode skimming: binary tree 10 (number of nodes of a complete binary tree)
Is it safe for Galaxy Securities to open an account online?
Oracle tablespace management