how to get whole JSON data from webservice at once?

how to get whole JSON data from webservice at once?

I'm trying to get JSON data from my webservice to display it in a data grid editor (developed with jquery) called Handsontable ( http://handsontable.com/ )

Basically my JSON looks like this:

  1. [
  2.     ["", "2012", "2013", "2014(YTD)"],
  3.     ["Ferrari", 1460089088.3900001, 1637243070.99, 283566771.55000001],
  4.     ["Alfa Romeo", 1199141138.1900001, 1224624821.1500001, 192307335.49000001],
  5. ]

What i want to do is passing the whole json from webservice to initialize the variable called myData in my html file at once. I mean without using loops etc - the simples way since i'm very inexperienced in jQuery and i'm little bit confused after all those different things i read on the internet.

Below you can download and/or see my html code:


  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  5. <link rel="stylesheet" type="text/css" href="/css/result-light.css">

  6. <script src="http://warpech.github.io/jquery-handsontable/lib/jquery.min.js"></script>
  7. <script src="http://warpech.github.io/jquery-handsontable/dist/jquery.handsontable.full.js"></script>
  8. <link rel="stylesheet" media="screen" href="http://warpech.github.io/jquery-handsontable/dist/jquery.handsontable.full.css">
  9. <link rel="stylesheet" media="screen" href="http://warpech.github.io/jquery-handsontable/demo/css/samples.css?20140401">
  10. <style type="text/css">
  11.      body {background: white; margin: 20px;}
  12.      h2 {margin: 20px 0;}
  13. </style>
  14. <script type='text/javascript'>
  15. $(document).ready(function () {
  16.       var myData = ( [
  17.       ["", "2012", "2013", "2014(YTD)"],
  18.       ["Ferrari", 1460089088.3900001, 1637243070.99, 283566771.55000001],
  19.       ["Alfa Romeo", 1199138.1900001, 1224821.1500001, 1923335.49000001],
  20. ]);
  21.   
  22. $('#myTable').handsontable({
  23.      data: myData,
  24.      minSpareRows: 1,
  25.      //colHeaders: true,
  26.      contextMenu: true,
  27.      readOnly: true,
  28.      fixedColumnsLeft: 1
  29. });
  30. });
  31. </script>
  32. </head>

  33. <body>
  34. <div id="myTable" class="handsontable" style="width: 400px; margin-left:auto; margin-right:auto; background-color:silver"></div>
  35. </body>
  36. </html>