title: Javascript return me object Object
body: <p>I have this code to create datatable with datatables.net plugin:</p>
  
  <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
      &lt;head&gt;
          &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
          &lt;title&gt;Untitled Document&lt;/title&gt;
          &lt;script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"&gt;&lt;/script&gt;
          &lt;script type='text/javascript' src='//netdna.bootstrapcdn.com/bootstrap/3.0.3/js/bootstrap.min.js'&gt;&lt;/script&gt;
  
          &lt;link rel="stylesheet" type="text/css" href="//netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css"&gt;
          &lt;link type="text/css" href="https://cdn.datatables.net/1.10.3/css/jquery.dataTables.css" /&gt;
          &lt;link type="text/css" href="https://cdn.datatables.net/plug-ins/380cb78f450/integration/bootstrap/3/dataTables.bootstrap.css" /&gt;
  
          &lt;script src="https://cdn.datatables.net/1.10.3/js/jquery.dataTables.min.js"&gt;&lt;/script&gt;
          &lt;script src="https://cdn.datatables.net/plug-ins/380cb78f450/integration/bootstrap/3/dataTables.bootstrap.js"&gt;&lt;/script&gt;
  
          &lt;script type='text/javascript' src="https://datatables.net/release-datatables/extensions/KeyTable/js/dataTables.keyTable.js"&gt;&lt;/script&gt;
  
      &lt;/head&gt;
      &lt;body&gt;
          &lt;script type="text/javascript"&gt;
              //   function day2Date( day, year ) {
              // return new Date(year,0,day);
              //}
              $(document).ready(function() {
  
                  $('#example').dataTable({
                      "ajax": "table1.php",
                      "columns": [{
                              "data": "ID"
                          }, {
                              "data": "naziv"
                          }, {
                              "data": "vrsta"
                          },
  
                      ],
                      "columnDefs": [{
                          "targets": 2,
                          "data": "download_link",
                          "render": function(data, type, full, meta) {
                              // return data; 
                              return '&lt;button class="btn btn-success"&gt;' + data + '&lt;/button&gt;';
                          }
                      }]
                  });
              });
              var table = $('#example').DataTable();
              $(document).ready(function() {
                  $('#example tbody').on('click', 'td', function() {
                      console.log('Data:' + $(this).html().trim() + 'Row:' + $(this).parent().find('td').html().trim() + 'Column:' + $('#example thead tr th').eq($(this).index()).html().trim());
                      // alert('Row:'+$(this).parent().find('td').html().trim());
                      //alert('Column:'+$('#example thead tr th').eq($(this).index()).html().trim());
  
                  });
                  $('#example tbody').on('click', 'tr', function() {
                      console.log('Row index: ', table.row(this).index());
                  });
              });
          &lt;/script&gt;
          &lt;div class="container"&gt;
              &lt;table id="example" class="table table-striped table-bordered table-responsitive" cellspacing="0" width="100%"&gt;
                  &lt;thead&gt;
                      &lt;tr&gt;
                          &lt;th&gt;ID&lt;/th&gt;
                          &lt;th&gt;Naziv&lt;/th&gt;
                          &lt;th&gt;Vrsta&lt;/th&gt;
  
                      &lt;/tr&gt;
                  &lt;/thead&gt;
  
                  &lt;tfoot&gt;
                      &lt;tr&gt;
                          &lt;th&gt;ID&lt;/th&gt;
                          &lt;th&gt;Naziv&lt;/th&gt;
                          &lt;th&gt;Vrsta&lt;/th&gt;
                      &lt;/tr&gt;
                  &lt;/tfoot&gt;
              &lt;/table&gt;
          &lt;/div&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I need to get row index so I write as you can see from code above:</p>
  
  <pre><code>$('#example tbody').on( 'click', 'tr', function () {
      console.log( 'Row index: '+table.row( this ).index() );
  </code></pre>
  
  <p>like I see on documentation on datatables web site but this code return me only <code>[object Object]</code></p>
  
  <p>example:</p>
  
  <pre><code>Data:12Row:2Column:Naziv 
  Row index: [object Object] 
  </code></pre>
  
  <p>Why? Sombody have explanation?</p>