I am working with some json data, and in the results set that i have i have 5 sets of information that i can choose from.
in my javascript i can see the data returned as objects when i call the line console.log(contacts.data["all"]);
a sample of the output is as follows which is from the debugging window from chrome
0: Object
allowanyoneedit: "True"
allowedit: "1"
charindex: "A"
country: "AF"
email: "xx@xx"
In the data that i have I want to get the email information,
so if i had;
0: Object
allowanyoneedit: "True"
allowedit: "1"
charindex: "A"
country: "AF"
email: "xx@xx"
1: Object
allowanyoneedit: "True"
allowedit: "1"
charindex: "A"
country: "AF"
email: "zz@xx"
and i wanted to return option the 1: object from the json how would i do this with the Javascript =========================edit=========================
this is the block where i know i am getting the data through to get teh array
for (var x in companies) {
var company = companies[x];
var opt = $("<option>").attr({ value: company.id }).text(company.name);
$("#contactcompany").append(opt);
console.log(company);
//$("#txtEmailTo").val();
console.log(contacts.data["all"]);
in the example i am working with there are 5 objects in the array
========================edit 2==============================
Data += "{"
For Each item In Columns.Split(",")
Dim Val As String = FormatJS(myReader(item).ToString)
If Val <> "" Then Data += """" & item.ToLower & """:""" & Val & ""","
Next
If CBool(myReader("AllowEdit").ToString) = True Then
Dim Val As String = FormatJS(myReader("AllowEdit").ToString)
If Val <> "" Then Data += """allowedit"":""" & Val & """"
End If
If Data.EndsWith(",") Then Data = Data.Remove(Data.Length - 1)
Data += "},"