Very simple JSON not working with Google json API

Very simple JSON not working with Google json API

I'm using the below code to load a json feed from google which looks like this:

// [ { "id": "14323395" ,"t" : "RBS" ,"e" : "LON" ,"l" : "43.68" ,"l_cur" : "GBX43.68" ,"ltt":"8:41AM BST" ,"lt" : "May 21, 8:41AM BST" ,"c" : "-1.14" ,"cp" : "-2.54" ,"ccol" : "chr" } ]

Now this doesn't work because of the // and the square brackets [ ] - if I remove these it works great, but obviously can't change this.

Any ideas how to get this working in jQuery?


  1. <script type="text/javascript">
  2. $(document).ready(function() {
  3. $.ajax({
  4.     dataType: 'json',
  5.     success: function(data) {
  6.         // do something
  7. $('.result').html(data.id);
  8.     },
  9.     url: 'http://finance.google.com/finance/info?client=ig&q=ftse:rbs''
  10. });
  11.  });