i haven't studied javascript and i am directly doing jquery, so i am not able to understand what this code tells us. please elaborate the following
Q1.why value of var txt begin with single quote here? In JSON file i don't think so this is the syntax.
Code:var txt = '{ "employees" : [' + '{ "firstName":"John" , "lastName":"Doe" },' + '{ "firstName":"Anna" , "lastName":"Smith" },' + '{ "firstName":"Peter" , "lastName":"Jones" } ]}';
Q2.why in the value " + txt + " is present? is this showing blank space then txt and then again space?
Code:var obj = eval ("(" + txt + ")");



Reply With Quote



Bookmarks