So I am having an issue of actually getting my data to load correctly to a new HTML page. The goal is to make it so when a label is clicked, a new page opens up with the data from that respective label. This project is using D3.
I'm following instructions given in this question, but when I click on a label (let's say it has two results), I get [object Object],[object Object]
as opposed to the actual data itself. Am I missing a step to get my actual data to output?
Code in parent:
label.on('click', function(){
var OpenWindow = window.open("results.html", "mywin", '');
OpenWindow.dataFromParent = results;
OpenWindow.init();
});
Code in child
<script type="text/javascript">
var dataFromParent;
function init() {
document.write("<p>" + dataFromParent + "</p>");
}
init();
</script>
Any help would be greatly appreciated! Thanks!