Javascript doesn't get or change value

I have a MySQL table that displays on a web page. I have a button for each row that switches the function using the value from the row:

<button id="loginButtonSmall" onclick="resumeApplication(<?php echo $row['newApplicationNumb']; ?>)">
 Pickup where we left off
</button>

The value is $row['newApplicationNumb']displayed correctly on the page up.

Here $row['newApplicationNumb']= 359786918929342363.

Then I:

function resumeApplication(applicationID) {
  var newApplicationNumb = applicationID;
  alert(newApplicationNumb); 
}

Refund warning: 359786918929342340.

Thus, it changes the last 2 digits from 63 to 40 every time ...

I looked around and really do not understand how this can change a value like this ...

Any tips would be greatly appreciated!

+4
source share
2 answers

: JavaScript, ?

, , . .

+5

javascript +/- 9007199254740991. , BigInteger.

- , . :

<button id="loginButtonSmall" onclick="resumeApplication(<?php echo $row['newApplicationNumb']; ?>)">
 Pickup where we left off
</button>

:

<button id="loginButtonSmall" onclick='resumeApplication("<?=$row['newApplicationNumb']?>")'> // Added quotation marks
 Pickup where we left off
</button>
+2

Source: https://habr.com/ru/post/1695795/


All Articles