0

i have to open a popup window, i use this code:

window.onbeforeunload = function(){

var windowincass = window.open('../Common/DomandaGenerica.jsp','domandagenerica','url=no,directories=no,titlebar=no,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,scrolling=no,resizable=no,width=300,height=200,marginwidth=0,marginheight=0,frameborder=0');
}

the windwow opens but it has the menù, url and others.

How can i fix it?

for example i want something like this:

https://i.stack.imgur.com/hOcXO.png

but i got something like that:

http://www.ajaxshake.com/public/usersFiles/main/ajax-example-windows-aero-style46_user_1_a3e5a.jpg

i have to use IE 9.

RudiDudi
  • 455
  • 1
  • 7
  • 18
  • Sounds like you're looking for a [*modal*](http://en.wikipedia.org/wiki/Modal_window), and not a separate window. – James Donnelly Nov 24 '14 at 15:08
  • Indeed. You can do it by yourself, or use a framework. Amongst others, jQuery has [dialogs](http://jqueryui.com/dialog/), Bootstrap has [modals](http://getbootstrap.com/javascript/#modals) etc. – James Thorpe Nov 24 '14 at 15:09
  • you mean that i can't do this with using only HTML/JAVASCRIPT? – RudiDudi Nov 24 '14 at 15:12
  • Yes, you can - "you can do it by yourself, **or** use a framework". These frameworks are just more html and javascript at the end of the day. But they save an _awful_ lot of time. – James Thorpe Nov 24 '14 at 15:14

2 Answers2

1

If you want a popup like in the first picture, you have to use a html element with basically following css properties, which shows up, when the Popup should be triggered.

CSS

position: absolute;
z-index: 9999;

It is not possible to change the Styles of the operating system with Javascript in all common browsers. And that is what you are trying to do, if you want to hide the title-bar, menu and so on...

Also have a look at:

This corresponds to your purpose.

Community
  • 1
  • 1
Tim Wißmann
  • 647
  • 6
  • 18
1

You are looking to open a overlay popup. For that, I suggest you use some JavaScript library.

jQueryUI dialog is one potential candidate. But there are many more:

window.open() will open new browser instance, and now it's almost always frowned upon. However, even with that you can control the appearance of the popup window to a certain extent by passing in WindowFeatures parameter as explained here (menubar, and status settings can be particularly helpful to you):

https://developer.mozilla.org/en-US/docs/Web/API/Window.open#Position_and_size_features

BuddhiP
  • 6,231
  • 5
  • 36
  • 56