w połowie kodu jest linia:
"content": zawartosc //<- ####Czemu tutaj nie podstawia wartości z zmiennej?




no i pytanie dlaczego zmienna zawartość nie jest podsawiana jej wartość

<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<title>Getting Started: Serving Web Content</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<!--<script type="text/javascript" src="../../static/js/html5-canvas-bar-graph.js" th:src="@{/js/html5-canvas-bar-graph.js}"></script>-->
</head>
<!--jop cos nie tak-->
<body >
<p id="name" th:text="${name}" />
<p id="lista" th:text="${name}" />
<div id="pieChart"></div>
<script src="//cdnjs.cloudflare.com/ajax/libs/d3/3.4.4/d3.min.js"></script>
<script type="text/javascript" src="../../static/js/d3pie.js" th:src="@{/js/d3pie.js}"></script>
<script>
document.addEventListener("DOMContentLoaded", function(event) {
var element = document.getElementById('name').innerHTML;
var zawartosc = element;
alert(zawartosc);
console.log(element);
console.log(zawartosc);
console.log(typeof zawartosc);
var pie = new d3pie("pieChart", {
"header": {
"title": {
"text": "Lots of Programming Languages",
"fontSize": 24,
"font": "open sans"
},
"subtitle": {
"text": "A full pie chart to show off label collision detection and resolution.",
"color": "#999999",
"fontSize": 12,
"font": "open sans"
},
"titleSubtitlePadding": 9
},
"footer": {
"color": "#999999",
"fontSize": 10,
"font": "open sans",
"location": "bottom-left"
},
"size": {
"canvasWidth": 590,
"pieOuterRadius": "90%"
},
"data": {
"sortOrder": "value-desc",
},
"labels": {
"outer": {
"pieDistance": 32
},
"inner": {
"hideWhenLessThanPercentage": 3
},
"mainLabel": {
"fontSize": 11
},
"percentage": {
"color": "#ffffff",
"decimalPlaces": 0
},
"value": {
"color": "#adadad",
"fontSize": 11
},
"lines": {
"enabled": true
},
"truncation": {
"enabled": true
}
},
"effects": {
"pullOutSegmentOnClick": {
"effect": "linear",
"speed": 400,
"size": 8
}
},
"misc": {
"gradient": {
"enabled": true,
"percentage": 100
}
}
});
});
</script>
<!--<p id="lista">${name}</p>-->
<!--<p id="lista" th:text="'Hello1, ' + ${name} + '!'" />-->
</body>
</html>