title: How to trigger a JavaScript function using the URL
body: <p>I really didn't know how to explain my question in the title, so I tried. </p>
  
  <p>Anyways, this is my problem. I have a webpage which is basically a puzzle. The basic premise of it is that when you visit a certain link, it will trigger a function and show the next piece. </p>
  
  <p>Here's one of the functions that will show the piece - </p>
  
  <pre><code>function showone() {
          var elem = document.getElementById("one");
           if (elem.className = "hide") {
              elem.className = "show"
              }
  }       
  </code></pre>
  
  <p>The reason that it's built like this, is because the pieces are constructed and placed using an HTML table, using classes to hide and show them.</p>
  
  <p>What I need to do, is somehow create a URL that will trigger a new piece. For example, "www.website.com/index.html?showone" is what I'd like. This would trigger the "showone" function. </p>
  
  <p>I don't know how to do this though, and after a fair bit of searching, I'm more confused than I was to begin with. </p>
  
  <p>The reason I'm using JavaScript to begin with, is that the page can't refresh. I understand that this might not be possible, in which case, I'm open to any suggestions on how I could get this to work. </p>
  
  <p>Thanks in advance, any suggestions would be greatly appreciated. </p>
  
  <p>-Mitchyl </p>