jquery - How to create javascript multidimentional array? -


This is what I need

Thus creating an array is required. I'm getting Spring MVC + AJAX + Jquery + google map 3.0 as a separate Jason reaction to these values.

 1. city name 2. long time 3. late 
  var marker = [[Bondi beach], -33.8, 9, 5442, 151.2,74,856], ['Qogi Beach', -33.9, 23,036, 151.2,5 9, 052], ['Cronula Beach', -34.02,28,24,151 .1,57,507], ['Manly Beach', -33.80010128657071, 151.28747820854187], ['Maroubra Beach', -33.950198, 151.25 9 302]];  

How to make a loop up with javascript array functions. It should have more than 20,30 records, this is a 3D array.

Please help me solve this problem

thanks all

show my script code below and modify it to get the results of my goal Help

  function jsonResponse () {var lengthitude = 0; Var latitude = 0; Var merchant = ''; Var Total = 0; $ .ajax ({url: 'merchantsList.html', datatype: 'json', contentType: 'application / json', mime type "application / json ', success: function (data) {longitude = data.longitude; Latitude = Data.latitude; merchant = data.merchant; total = data.length;}, error: function (data, position, er) {warning ("error:" + data + "status:" + status + "er:" + Er);}}); Var markers = [['Bondi beach', -33.8, 9, 5542, 151.2, 74, 856], ['Qogi Beach', -33.9, 23,036, 151.2,5 9, 052], [ 'Cronulla beach, -34k0,28,24 9, 151.1,57,507], [' Manly beach ', -33.80010128657071, 151.28747820854187], [' Maroubra beach ', -33.950198, 151.259302 ]]; Var infowindow = new google.maps.InfoWindow (), marker, i; Google.maps; {Marker = new. Google.maps.marker (for new google.maps.LatLng (latitude, longitude), map map} {status}} (; I & lt; markers.length i ++ i = 0) .event KaddListener (marker function (marker, i) 'click', ({; infowindow.open (map, markers);}; return function () {infowindow.setContent (marker [i] [0])}) (marker , I)); } Text after "

What has been returned from the AJAX query; The name of the city == ajax data in the trader.

There are not many merchant / longitude / latitude items coming back from data merchantsList.html, so if you need to iterate over the data and add each to the marker array.
It will

  var marker = []; // Ajax call start here .. // ... success: function (data) {var i, item; (I = 0; i & lt; data.length; i ++) {item = data [i]; Marker Peash ([item. Trader, item shape, item. Latitudes]); }} // ajax call end here  
code

Comments