You can follow the steps for doing the setup of JavaScript Object Notation variable :
You will have to type the coding in your javascript area. Here is an example of code :
Code:
var displayMessages = {
sayHi: "hi",
sayBye: "bye"
};
Now if you want to make globally accessible object references within your javascript file, you can use the following JSON :
Code:
var myObjects = {
objectOne: function() {
return document.getElementById('myNameIdHere');
},
objectTwo: function() {
return document.getElementById('myNameIdHere1');
}
};
Bookmarks