JavaScript - How can I make toolbar,menubar,... invisible?

Asked By mostafa on 09-Feb-11 08:52 AM
How can I make toolbar,menubar,addressbar,statusbar,... invisible to user when he/she comes to visit my website?
Thanks if you answer.
Peter Bromberg replied to mostafa on 09-Feb-11 08:55 AM
You cannot. The only way to control whether these items display in the browser or not is to use the javascript window.open function:

http://msdn.microsoft.com/en-us/library/ms536651(VS.85).aspx


Mihir Soni replied to mostafa on 09-Feb-11 08:58 AM
Hello,

For that you need to open your browser in full screen mode

write following code in your head tag

if (this.name!='fullscreen'){ 
  window.open(location.href,'fullscreen','fullscreen,scrollbars') 

for more info follow the link

http://javascript.internet.com/navigation/full-screen2.html
Jatin Prajapati replied to mostafa on 09-Feb-11 09:03 AM
Hi Mostafa,
There is no control on user's browser when they come to visit you web site. But you can do one thing. On the home page write the javascript which open the popup windows which display only page and hide statusbar, addressbar, menubar, etc.. and close that previous page. See the below example. On thing to remember that, if end user browser has blocked popup, then this will not work properly.

<%@ Page Language="C#" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<script runat="server">
  protected void Page_Load(object sender, EventArgs e)
  {
    if (!IsPostBack)
    {
       
    }
  }   
</script>
 
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
  <title></title>
  <script type="text/javascript" language="javascript">
    var url = window.location.toString();
    if (url.indexOf('reopened') == -1) {
      window.open(window.location + '?reopened=1', '_blank', 'status=0,menubar=no,location=no,toolbar=no');
      window.close();
    }
  </script>
</head>
<body>
  <form id="form1" runat="server">
  <div>     
     
  </div>
  </form>
</body>
</html>
mostafa replied to mostafa on 10-Feb-11 12:51 AM
Thanks for your replies.
I knew all of these.
Now I have another question. When the command 'window.close()' executes in IE, it alerts to user if he/she wants to close the current window. How Can I Disable This Feature?