Title, today in the project update found the JS of this automatic conversion problem, the code is as follows:
var num = 0110;
Render:function (num) {
var html= "<a href=\" javascript:viewaccountinfo (' <%=path%> ', "+num+") \ ">" +num+ "</a>";
return HTML;
}
A hyperlink was made to bind the specified number to the Viewaccountinfo method, and the previous run had no problem until
This morning showed a number 0, originally should pass 0110 to the backstage, but the background has been the error message that the specified index could not be found,
The front desk alert found that the pop up unexpectedly is 156, and then began to compare database, debug, run process, to determine the background data no problem.
Heartbroken 0110 changed to 1110 after the problem unexpectedly good, immediately take this as a breakthrough Baidu, sure enough, JS in the value transfer process
The 0 or 0X will be automatically converted to the head, 0 will be converted to 8 (that is, 156), the beginning of 0 x will be out of 16 into the system.
Know the problem after the good run, directly to the string form as follows:
var html= "<a href=\" javascript:viewaccountinfo (' <%=path%> ', ' +num+ ') \ ">" +num+ "</a>";
Have you seen where the change is? o (∩_∩) o ha! , just add a set of single quotes to Num's double-quoted ". It's that simple.
JS Numeric type 0 start automatically converted to 8 binary