JSON اسئلة واجوبة المقابلات
Question: Compare JSON with JavaScript.Answer: JSON is a subset of the object literal notation of JavaScript> JSON can be used in the JavaScript language with no muss or fuss Example: JSON Object var myJSONObject = {"bindings": [ {"ircEvent": "PRIVMSG", "method": "newURI", "regex": "^http://.*"}, {"ircEvent": "PRIVMSG", "method": "deleteURI", "regex": "^delete.*"}, {"ircEvent": "PRIVMSG", "method": "randomURI", "regex": "^random.*"} ] }; In this example, a JSON JavaScript object is created containing a single member "bindings", which contains an array containing three objects, each containing "ircEvent", "method", and "regex" members Members can be retrieved using dot or subscript operators myJSONObject.bindings[0].method // "newURI" Text to Object Conversion in JavaScript code var myObject = eval('(' + myJSONtext + ')'); To convert a JSON text into an JSON object, use the eval() function > eval() invokes the JavaScript compiler > Since JSON is a proper subset of JavaScript, the compiler will correctly parse the text and produce an object structure |
احفظ للمراجعة
احفظ هذا العنصر في الإشارات المرجعية، او حدده كصعب، او ضعه في مجموعة مراجعة.
سجل الدخول لحفظ الإشارات المرجعية والاسئلة الصعبة ومجموعات المراجعة.
هل هذا مفيد؟ نعم لا
الاكثر فائدة حسب تقييم المستخدمين:
- Who is the Father of JSON ?
- What is the file extension of JSON?
- What is JSON?
- Why use JSON over XML?
- Explain JSON with php.