title: Changing url via html button with JS
body: <p>I'm trying to have different html buttons that send user's to different sections of their profile (social, news, email, etc.) So I made a simple JS function which I linked into the html. Basically when a user clicks a button, it should append the current URL with a string and then visit that URL. On click, however, nothing happens:</p>
  
  <p>profile.html</p>
  
  <pre><code>&lt;head&gt;
    &lt;title&gt;Profile&lt;/title&gt;
  &lt;/head&gt;
  &lt;script type="text/javascript" src="profile.js"&gt;&lt;/script&gt;
  &lt;body&gt;
    &lt;h1 align=center&gt;Welcome to your OmniCloud Profile&lt;/h1&gt;
    &lt;h2 align=center&gt;Access your content below&lt;/h2&gt;
    &lt;button name='email' onclick='gotoPage("email")'&gt;Email&lt;/button&gt; &lt;br/&gt;
    &lt;button name='social' onclick='gotoPage("social")'&gt;Social&lt;/button&gt; &lt;br/&gt;
    &lt;button name='news' onclick='gotoPage("news")'&gt;News Feeds&lt;/button&gt; &lt;br/&gt;
    &lt;button name='media' onclick='gotoPage("media")'&gt;Media&lt;/button&gt; &lt;br/&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>And here is the JS script</p>
  
  <pre><code>function gotoPage(var url) {
    var newurl = document.write(location.href)
    newurl += url
    window.location.assign(newurl)
  }
  </code></pre>
  
  <p>I'm using Django, so if there is a better way to handle this (perhaps using urls.py, feel free to include that!</p>