I am referring code one of my colleague and he used Var in JSON file is there any specific reason behind it or he wants to use JS file.
He also mentioned <script type="text/javascript" src="player-settings.json"></script>
JSON:
var globalSettings ={
//data
};
var languageToSelect ={
"en":"English"
};
var menuSettings ={
"name":"Menu",
"isStrictlyLinear":false,
"pageCompleteOnView":true,
"completeAllInteraction":false,
"modules":{
//data
},
"lessons":{
//data
},
"topics":{
//data
},
"pageCompletion":{
//data
},
"bodySettings":{
//data
}
};
I referred this link to know why we used a script tag to load JSON but in my case, he used type as "text/javascript" and in JSON var is used which leads me to confusion. Is there any specific reason to use Var in JSON file?