I'm getting some issues with a function, where i'm passing 2 arguments, one of them contains a string "12345.00" the main problem is that on console.log(string) this return only "12345".
Is there a way to get the entire string?
$data = array(
array(
'arg1' => '1',
'arg2' => '123'
),
array(
'arg1' => '2',
'arg2' => '12345.00'
)
);
<button id="openTab">Test</button>
foreach($data as $item){
<script>
$('#openTab').click(function(e){
e.preventDefault();
getValues(<?php echo $item['arg1'](); ?>, <?php echo $item['arg2']; ?>);
});
</script>
}
function getValues(arg1, arg2){
console.log(arg2);
new Ajax.Request("<?php echo $this->getUrl('getValues') ?>", {
method: 'POST',
type: 'json',
parameters: { arg1: arg1, arg2: arg2},
onComplete: function(transport) {
var result = JSON.parse(transport.responseText);
console.log(result);
}
});
}
"12345.00"in Chrome.getValues('1', '12345.00'); > 12345.00Are you manipulating the value in any other way?12345.00to a number, so there's code missing from the example.