title: Solution for javascript window.close()?
body: <p>I have been searching online to peform window.close() using the javascript. I have a MVC application,when i click on logoff button the page should close.</p>
  
  <p>I know that the window.close is not working now a days as there is some security reasons. Getting the message "Scripts may close only the windows that were opened by it".</p>
  
  <p>Tried almost all the options to close the window but nothing works till now.</p>
  
  <pre><code>&lt;a href="#" onclick="javascript:window.close();"&gt; method1 &lt;a/&gt; 
  &lt;a href="javascript:window.open('','_self').close();"&gt;method2&lt;/a&gt;
  &lt;a href="javascript:window.top.close();"&gt;method2&lt;/a&gt;
  </code></pre>
  
  <p>Any help is appreciated.</p>
  
  <p>Thanks</p>
  
  <p>Dev</p>