I'm having trouble to iterate over JSON file and get his parameters, this is an example of JSON file i created:
{
"One": { "Username": "", "Password": "", "unique3": "", "unique4": "", "unique5": "", "freeTextArea": "" },
"Two": { "Username": "", "Password": "", "SecretKey":"", "Autologinurl":"", "CrmUid":"", "freeTextArea":"" },
"Three": { "Username": "", "Password": "", "freeTextArea": "" }
}
I have this HTML
input attribute:
<input type="text" name="platform" placeholder="Platform" id="platform"/>
What I want is to check if the Input
is matching "one"/"two"/"three" from the JSON
, and then create new input elements using DOM
based on the parameters "one"/"two"/"three" have.
This is how I'm getting the JSON data using AJAX:
var platformJson = $.getJSON("platform.json");
How can I iterate correctly over this JSON file?