APEX JAVASCRIPT JSON Visual Force

Json in Apex class and Visualforce

Serializing JSON from Apex  Apex Class: public with sharing class jsonAccount { public string AccountNameList {get;set;}  public jsonAccount() {    list accList = [Select Id,Name From Account];     System.debug(JSON.serialize(accList));    AccountNameList = JSON.serialize(accList); } } Output:USER_DEBUG [2]|DEBUG|[{“attributes”:{“type”:”Account”,”url”:”/services/data/v24.0/sobjects/Account/001U0000002LdBXIA0″},”Id”:”001U0000002LdBXIA0″,”Name”:”GenePoint”},{“attributes”:{“type”:”Account”,”url”:”/services/data/v24.0/sobjects/Account/001U0000002LdBYIA0″},”Id”:”001U0000002LdBYIA0″,”Name”:”United Oil & Gas, UK”},{“attributes”:{“type”:”Account”,”url”:”/services/data/v24.0/sobjects/Account/001U0000002LdBZIA0″},”Id”:”001U0000002LdBZIA0″,”Name”:”United Oil & Gas,…

Read More