0

How can I disable address bar and back button in browser in html file?

Something Like this :

Here is the demo :http://jsfiddle.net/n5pKP/5/

JS:

$('.popup').click(function () {
    var curr_browser = navigator.appName;
    if (curr_browser == "Microsoft Internet Explorer") {
        window.opener = self;
    }
    window.open('http://www.google.com/', 'null', 'width=900,height=750,toolbar=no,scrollbars=no,location=no,resizable =no');
    window.moveTo(0, 0);
    window.resizeTo(screen.width, screen.height - 100);
});

HTML:

<a target="_parent" href="javascript:void(0);" class="popup">Open new window</a> 

Right now its opening on click. I want to open it directly as popup. Like I double click on test.html , its should appear my html data and disabled address bar and with no back button.

How it can be done?

codingrose
  • 15,563
  • 11
  • 39
  • 58
Hassan Sardar
  • 4,413
  • 17
  • 56
  • 92

2 Answers2

1

You may try like this

<input id="Button1" type="button" value="button" onclick="window.open('WebForm1.aspx','PoP_Up','directories=no,titlebar=no,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=1024,height=768');" />

This is supported in top browser

Rathod Paresh
  • 221
  • 2
  • 4
0

The JavaScript API exists, just that due to security issues, browser vendors disabled the hiding of the address bar.

Hiding the address bar of a browser

Instead, you could make a modal within the browser window. Twitter Bootstrap or something like this: http://sandbox.scriptiny.com/tinybox2/

Community
  • 1
  • 1
ambrosechua
  • 139
  • 1
  • 7