location.reload(), Javascript,HTML
<p>I'm having a problem always when I try to use the following code in a button in my HTML file.</p>

<pre><code>onClick=window.location.reload();
mapGenerator();
</code></pre>

<p>The page reloads but the javascript (mapGenerator) that make a D3JS view doesn't appear. What am I doing wrong?</p>