Click here to Skip to main content
15,885,953 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How do i get "LSZ09".
C#
var el1=data[0];
alert(el1);

This gives me "a" from array, as position 1 gives me r, 2 r, 3 a, 4y ,..
The array is received through a " echo json_encode($punten); "

PHP
$.ajax({ url: 'getPunten.php',
                        data: {statnam: jSelectedStation[0]},
                        type: 'get',
                        success: function(data) {


VB
array(260) {
  [0]=>
  array(14) {
    ["STATDEV"]=>
    string(6) "LSZ09 "
    [0]=>
    string(6) "LSZ09 "
    ["DEVPKT"]=>
    string(1) "1"
    [1]=>
    string(1) "1"
    ["PKTTYP"]=>
    string(1) "S"
    [2]=>
    string(1) "S"
    ["KARTNR"]=>
    string(1) "0"
    [3]=>
    string(1) "0"
    ["BITNRK"]=>
    string(1) "1"
    [4]=>
    string(1) "1"
    ["BITSTATUS"]=>
    string(1) "0"
    [5]=>
    string(1) "0"
    ["TYPE"]=>
    string(2) "I "
    [6]=>
    string(2) "I "
  }
Posted
Updated 29-Oct-13 0:22am
v2

1 solution

 
Share this answer
 
Comments
firebird33 29-Oct-13 6:31am    
It's not the same cause i don't have a corresponding 'apResults'
Ranjan.D 29-Oct-13 7:29am    
All you need to do is, on success of your Ajax call do something like below


var jsonDataArray = JSON.parse(data);

Then loop through the array and access JSON properties.
firebird33 29-Oct-13 7:44am    
SyntaxError: JSON.parse: unexpected character
var jsonDataArray = JSON.parse(data);

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900