View Full Version : don't show modeless window address

05-19-2012, 12:10 PM
1) Script Title: Modeless Window

2) Script URL (on DD):

3) Describe problem:
It's not a problem. I want it NOT to display the URL in the title bar.

I have a question about how to get rid of the URL in the title bar, or to substitute something else.
Either one would be fine.

I am using it to provide a small page with a question on it. (I'm a teacher and am developing a question / answer side bar which accompanies video lessons.)

Here is all the code; I have only changed the page name for the link.


//Modeless window script- By DynamicDrive.com
//for full source code and terms of use
//visit http://www.dynamicdrive.com

function modelesswin(url,mwidth,mheight){
if (document.all&&window.print) //if ie5

//configure URL and window dimensions (width/height)

//To load via link, use something like below:
//<a href="javascript:modelesswin('http://yahoo.com',600,400)">Click here</a>

Thanks very much for any help!

05-20-2012, 12:38 AM
Security built into every browser requires that a window show at least its base url. This is to prevent 'phishing' via the spoofing of another sites content. Like if you put up a page that looks like a bank's or PayPal's and ask the user to login, you could then garner their username, password and perhaps other sensitive data.

Because of that fact, honest designers such as yourself cannot use the browser window to show content without it at least identifying its base URL.

Most browsers show the complete address in an address bar that cannot be avoided, others just the base URL in an identifying bar that only appears when the address bar has been suppressed.

When this script was first developed this was not the case and a window without any identifying information was possible. Even what is known as a completely chromeless window was possible. That was a window without any information or decoration other than a border.

These sort of effects are still possible - sort of, but only with a pseudo window which is actually an absolutely position division from the launching page. Because of that it's not an independent window though. It cannot appear outside the borders of the launching page and ends when the launching page ends.

If you want that sort of 'window', use Lightbox or a lightbox type script. Here's one that looks a lot like a real window:


and one where it just pops up the information:


and something a bit more versatile but also more complex:


Scripts like these have their own limitations though as already mentioned, and others you may discover if you choose to use one. But they do afford some advantages over an actual window. But from your description it sounds like they might be a good fit for your purpose.

05-21-2012, 02:25 PM
John --
Thanks so much for your informative answer. I did not know that about the URL. And, of course, it makes huge sense. And, I will still use what I am using now, simply because it works so well!

To further impose on you, if I may ---

I would really like to be able to tell the new window where to place itself. Is that

Thanks so much,

05-21-2012, 06:33 PM
In IE it uses the showModelessDialog method which places the new window in the center of the user's screen. In all others it uses the open method, for which you may (using the modified script below) specify the top and left coordinates:


//Modeless window script- By DynamicDrive.com
//for full source code and terms of use
//visit http://www.dynamicdrive.com

function modelesswin(url,mwidth,mheight,mtop,mleft){
if (window.showModelessDialog){ //if ie5

//To load via link, use something like below:
//<a href="ext.htm" onclick="modelesswin(this.href,300,300,250,400);return false;">ext</a>

They are, for the example link 250 and 400 respectively, as highlighted above.

If you want them all to be centered, that can be arranged, or if you want IE to use the open method too so that it will be positioned as set in the link code, that can be done too.

Be aware that if you specify numbers for top and left, theses will be in relation to the user's screen. On larger screens it will be proportionately closer to the top and left, on smaller ones, farther. So much so on smaller screens that it might be too far to the right or bottom to be fully seen, or seen at all.

For that kind of control, use:


One odd man out for this in the browser world is Opera. It sees top and left differently than all others and dependent upon factors that cannot be read from it, so cannot really be relied upon to position a new window as desired. Often it still renders it 'in the neighborhood' though usually lower.

Considering all that, it might be a good idea not to position it (use the original code). At least that way the browser will show the whole thing if at all possible.

05-22-2012, 09:10 AM
Thanks again John -- I'm pretty proficient in CSS and HTML, but sadly lacking in JS. I've not found the language to be a good match with me. (I'm much happier with PHP and recently Python.)

My presentation at the Academic Retreat is the day after tomorrow, and this issue was bugging me. My summer project will be an attempt at a whole UI within a broswer window for playing teaching videos accompanied by question/answer sections. Along the lines of the courses taught at udacity.com.

Again, I thank you so much for your help and advice. (I don't know how to mark this solved. Maybe I'm too junior. -- But if you can do it, please do so!)

Later: John, I could not get the original window to resize at all. So, I looked at your other suggestions and tried the last one--popwin-- and that worked.

After all your help, I thought you might like to see. The video there is just a placeholder and the questions are just sample questions for coding purposes. I'm just flashing this on the screen near the end of my presentation to show them what I will be working on for the summer. Only the questions under Unit 1 are activated at this point.


(The one that didn't work is index4.html)