Code Robo
Virtual Service
Tester / Comparator
Converter
Utility
Java Code Complience
Validator
Formatter
EncoderDecoder

JSON to JavaScript Converter

Json and JavaScript are used in any Java/J2EE application. Generating JavaScript from JSON string is very common requirement.JSON to JavaScript converter tool generates JavaScript code from JSON string. Take JSON string as input and produce JavaScript code. It generate parsing code of JSON String using JavaScript.

JSON.(* Required): It is required.
Root Element Name :


How It Works:
First validate the json string. Then parse it to token and generate the javascript code.
Steps to follow:
  1. Provide your JSON string in the text box..
  2. Click on the 'Convert To JavaScript' button
  3. Code engine inspect the JSON String. check the correctness of the input json string.
  4. Generate the JavaScript code to process the JSON script.
  5. Generate JavaScript object navigation path..
  6. Copy the JavaScript code and put it in your JavaScript editor.
If there are any errors in the JSON and the converter isn't able to do generate JavaScript code, the error message will appear in the output box with error details and line number.
JSON Example:
  { "firstName": "",
     "lastName": "",
     "dateOfJoining": "",
     "dependants": {"dependant": [{ "name": "",
             "mediclaimPolicy": { "endDate": "",
                 "policyName": "",
                 "sumInsuredAmt": "",
                 "coverageDetails": "",
                 "policyNo": "",
                 "startDate": "" },
             "location": "",
             "age": "",
             "relation": "" }]},
     "designation": "",
     "department": "",
     "employeeNo": "" 
}

Generated Code:
 
var employeeObj =  { firstName: "",
     lastName: "",
     dateOfJoining: "",
     dependants: {dependant: [{ name: "",
             mediclaimPolicy: { endDate: "",
                 policyName: "",
                 sumInsuredAmt: "",
                 coverageDetails: "",
                 policyNo: "",
                 startDate: "" },
             location: "",
             age: "",
             relation: "" }]},
     designation: "",
     department: "",
     employeeNo: "" 
};

Object Navigation:
 
employee
employee.dateOfJoining
employee.department
employee.designation
employee.employeeNo
employee.firstName
employee.lastName
employee.dependants
employee.dependants.dependant
employee.dependants.dependant.age
employee.dependants.dependant.location
employee.dependants.dependant.name
employee.dependants.dependant.relation
employee.dependants.dependant.mediclaimPolicy
employee.dependants.dependant.mediclaimPolicy.coverageDetails
employee.dependants.dependant.mediclaimPolicy.endDate
employee.dependants.dependant.mediclaimPolicy.policyName
employee.dependants.dependant.mediclaimPolicy.policyNo
employee.dependants.dependant.mediclaimPolicy.startDate
employee.dependants.dependant.mediclaimPolicy.sumInsuredAmt