Hi,
Please have a look at the following code
In the above function what I am trying to achieve is to create a JSON array that will be like the followingCode:function show() { var columnHeaders = [ {key:"id_no"}, ]; var keyValue = columnHeaders[0].key; var JSONArray2 = [{keyvalue:"testing"}]; }
The question is how I can specify a key value using a variable name in which the original key value I want to use?Code:JSONArray2 = [{"id_no":"testing"}]
Now below code
gives the followingCode:var keyValue = columnHeaders[0].key; var JSONArray2 = [{keyvalue:"testing"}];
Please help me to understand this problemCode:JSONArray2 = [{keyvalue:"testing"}]
Regards
CodeExploiter



Reply With Quote

Bookmarks