document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. <script>
  2.     function print() {
  3.         var user = JSON.parse(document.getElementById(\'user\').dataset.user);
  4.         console.log(user);
  5.     }
  6. </script>
  7.  
  8. <td id="user" data-user=\'<?php echo json_encode(array(\'name\' => \'oshan\', \'id\' => 91)) ?>\'>
  9.     <button onclick="print();">Print</button>
  10. </td>
');