My structure is shown below:
My manifest.json is shown below:
{
"manifest_version": 2,
"name": "Doktor-MD",
"description": "Tarayıcı üzerinden Doktor-MD'de link paylaşımı yapabilirsiniz.",
"version": "1.0",
"permissions": [
"http://www.google.com/"
],
"browser_action": {
"default_icon": "icon.png",
"default_popup": "index.html"
}
}
My index.html is shown below:
<!DOCTYPE html>
<html>
<head>
<META http-equiv=content-type content=text/html;charset=utf8>
<META http-equiv=content-type content=text/html;charset=windows-1254>
<META http-equiv=content-type content=text/html;charset=x-mac-turkish>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"> </script>
<script src="doktormdcore.js"></script>
<title>Doktor TV Md</title>
<script type="text/javascript">
function GetDataFunction()
{
var xhr = new XMLHttpRequest();
xmlHttpRequest.onreadystatechange = handleStateChange; // Implemented elsewhere.
xmlHttpRequest.open("GET", chrome.extension.getURL('/config_resources/config.json'), true);
xmlHttpRequest.send();
}
</script>
</head>
<body>
<table>
<tr>
<td>GetData</td>
<td><input type="button" id="GetData" value="Getir" onclick="GetDataFunction"/></td>
</tr>
</table>
</body>
</html>
My config.json data(example data) is shown below:
{
"glossary": {
"title": "example glossary",
"GlossDiv": {
"title": "S",
"GlossList": {
"GlossEntry": {
"ID": "SGML",
"SortAs": "SGML",
"GlossTerm": "Standard Generalized Markup Language",
"Acronym": "SGML",
"Abbrev": "ISO 8879:1986",
"GlossDef": {
"para": "A meta-markup language, used to create markup languages such as DocBook.",
"GlossSeeAlso": ["GML", "XML"]
},
"GlossSee": "markup"
}
}
}
}
}
I want to get json data from my config.json. But how can i test this code to ensure that they are working. And do you think am i correct? Is this right way to get json value from locally?