Jump to content

Problem with IE7 address bar


jeffg

Recommended Posts

I am using a heavily-modified version of Denis Gritcyuk's popup calendar script. The calendar window is opened with the following:

	var vWinCal = window.open("", "Calendar",		"width=200,height=190,menubar=no,toolbar=no,location=no,status=no,"+				"resizable=no, "top="+(cY-100)+",left="+(cX+20));

(a few of the no's I added myself). However, IE7 insists on displaying the address bar as shown below. I was hoping the 'location=no' attribute would stop this. Is there any solution?both_cal.pngAs a supplementary: can I make this 'always on top', so it doesn't disappear behind if the user clicks elsewhere on the screen?

Link to comment
Share on other sites

this is what IEBlog says

We think the address bar is also important for users to see in pop-up windows. A missing address bar creates a chance for a fraudster to forge an address of their own. To help thwart that, IE7 will show the address bar on all internet windows to help users see where they are.
Link to comment
Share on other sites

About the always on top, there's not a way you can do that with just any browser window. You can put code on your own site so that if they click back on your other page then it will re-focus the calendar window, but that might be annoying if any time they click on your window it focuses the other window, they wouldn't be able to scroll or type in a form or things like that.

Link to comment
Share on other sites

Thanks for the info. I see there is quite a heated discussion about popups in that blog. Well, since I have to live with it, I have now put "Calendar" in the URL parameter of the window.open call, which puts a more meaningful (though false) URL in the address bar, instead of 'about:blank'.As for the always on top thing, I think what I really mean is that I would like to make the popup modal. My users will be pretty naïve, which is why I don't want them losing the calendar, then clicking the button again and wondering why nothing happens. I guess this is something else I have to code round.PS: Love the Babbage and Cristin quotes.

Link to comment
Share on other sites

Exactly. Just what I figured out for myself before checking back here :) All works fine now, thanks.Edit: Actually, since the function is called by the onclick event from the button and the variable is inside the function, it still executes the window.open each time the button is clicked, but doesn't actually [appear to] create a new window if it already exists - the focus() just brings the existing window to the front.This is the code snippet now:

	var vWinCal = window.open("", "Calendar",		"width=200,height=190,resizable=no,"+		"top="+(cY-100)+",left="+(cX+20));	vWinCal.opener = self;	vWinCal.focus();

Link to comment
Share on other sites

It should bring the existing window to the front because you declare the window with a name. Each time you let the window.open be called, as the second parameter is "Calendar", the window with name "Calendar" is opened or a new one will be created. If it exists, it takes that one :)Declaring that second paramter explicitly as "_blank", will let it open a new window each time, even if there has been opened one before.A modal window is actually possible in Internet Explorer only, however, you will have to use something that is not supported in other browsers than IE. If that doesn't matter to you, ie when you think your users will only use IE, you could use the showModalDialog() method instead of open(). But it is not cross-browser, bear that in mind.

Link to comment
Share on other sites

Thanks - that's the behaviour I want. As for IE-only stuff, my modus operandi is "develop for Firefox, tolerate IE users" :) Having said that, I have just posted over in the HTML forum about a file input which appears to work in IE, but not in FF :)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...