title: how to redirect to current page using javascript
body: <p>i have my index page in which i am directing a link something like this </p>
  
  <pre><code>&lt;li onClick="CreateUser()"&gt; &lt;a href="#CreateUser"&gt;CreateUser&lt;/a&gt;  &lt;/li&gt;
  </code></pre>
  
  <p>on click of this create user list item i am populating the main page content as </p>
  
  <pre><code>function Create User(){ 
  $("#main-content").html('Welcome to user management');
  }
  </code></pre>
  
  <p>in my index.html to display some text when user first visit the page ,i have the main-content as </p>
  
  <pre><code>&lt;div id="content"&gt;
      &lt;div class="outer"&gt;
        &lt;div class="inner" id="main-content"&gt;
  
          &lt;div class="col-lg-12"&gt;
            &lt;!--the index dashboard body goes here  --&gt;
              index page content
  
          &lt;/div&gt;
        &lt;/div&gt;&lt;!-- /.inner --&gt;
      &lt;/div&gt;&lt;!-- /.outer --&gt;
  &lt;/div&gt;&lt;!-- /#content --&gt;
  </code></pre>
  
  <p>what i want to do is when i refresh when i am on </p>
  
  <pre><code>localhost:/example/index.html#CreateUser
  </code></pre>
  
  <p>then it should display the content of CreateUser function </p>
  
  <p>so far , i have tried doing this in index.html page</p>
  
  <pre><code>&lt;body onLoad="checkRefresh();"&gt;
  
  where "check Refresh()" is 
  
  function check Refresh()
  {
  var geturl = window.location.href;
  if (geturl = 'http://localhost/example/index.html#CreateUser')
  $("#main-content").html('Welcome to usermanagment');
  }
  </code></pre>
  
  <p>but it directs all other page on refresh to this content </p>
  
  <p>how to do this </p>