My python code creates HTML files. I work on Anaconda Enterprise and my problem is that I want to read an external json file in javascript encapsulated in HTML
message = """
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="sample.json"></script>
</head>
<body>
<p id="GFG_DOWN" style="color: green; font-size: 20px; font-weight: bold;"></p>
<script>
function pointe_vers_doc(clicked) {
var test = document.getElementById("GFG_DOWN");
var mydata = JSON.parse(data);
test.innerHTML = "Value of my json = "+mydata[0];
}
</script>
</body>
</html>
"""
Here is the external json (sample.json) I want to read :
data='[["first", "second"], [], ["fourth"], [], [], ["seventh"]]'
Locally it works but on the server (AE) I think it does not find the path to sample.json I tried to change the path several times by testing but it doesn't work. Is there another way to proceed ?