Make the returned JSON into a global array.

Make the returned JSON into a global array.

classic12classic12 Posts: 228Questions: 60Answers: 4

I am using the following to bring back some JSON data.

I want to use

var selectedArray =[] // global array.

How do I assign the returned data to selectedArray

       ajax :       { 
                            'url' :  'http://www.xxxx.com/php/xxxx.php',
                            "type": "POST",
                                  "data": {
                                                'selectedInvoiceID': selectedInvoiceID
                                              }
                                        
                          },

Cheers

Steve Warby

Answers

  • allanallan Posts: 61,446Questions: 1Answers: 10,054 Site admin

    Use the xhr event to gain access to the JSON returned by the server, and you can assign it to your variable as required there.

    Allan

This discussion has been closed.