Opening web app in a new window after login. how?

Reference: the non-working code

window.open("home.php","_blank","toolbar=no","location=yes","directories=no","status=no","menubar=no","scrollbars=no","resizeable=no","copyhistory=yes, width=1280, height=800");

Thanks.

All of the parameters after “_blank” need to be contained within the same set of quotes. It’s also important to ensure that the third set of parameters have no spaces between the commas.

do u think that is the issue?

Yes. The list of window features must be specified as one string.
See: https://developer.mozilla.org/En/DOM/Window.open

Yes, this is what I was telling you 10 posts ago (:

The issue i get was in IE, i don’t know to ask this or not as my dev machine lcd is gone for repair. but will it fix in IE?

Let’s put it this way.

You won’t fix the issue by leaving the code in the same non-standard format that is causing you the problem.

ok thanks. another thing can i close the window after the login button is clicked (when the new window open, the previous one closes). is it possible?

I don’t believe so, not with Javascript.

I remember reading that Javascript (thankfully!) only has control over windows which it itself has opened.

Imagine if JS could just close your browser window will-nilly!

Again, though, you have to look at the original reason you were asked t build it this way. What was the advantage/purpose of the app opening in the new window?

What if the client has blocked new windows? Oooh, you’d be closing their browser entirely!

What if they had other tabs and stuff open in that browser? What if they logged into your app while downloading something from another site??

While you can use Javascript to ask kindly if the browser would allow a new window to be opened, remember you are only HOPING this will happen. The user has full control (as they should, generally) and so you are going to have users without any new window anyway. So, closing the old one, you may need to ask your client what the reason for this is.

If there’s some other reason, then maybe a whole different solution could tackle that. Like removing old pre-login information? Have the server clear and refresh that page, or present a different page, or something (in the old window).

@poes…well i discussed the pros and cons of popup etc prior to developing the web app but like they say client is always right. i can imagine if the user has popup blocker. it would be a chaos :stuck_out_tongue: but still lets hope for the best and until we make it live we won’t get the feedback.

but like they say client is always right.

Except if through the client’s ignorance, it causes the client to lose customers/visitors. At the very least, make them sign a paper saying they insisted on it, so they can’t turn around later and blame you the developer for losing customers/visitors.

IIRC, the Javascript function popup() was blocked by my FF natively, but other methods of calling a new window were not. You’ve already tested the new window code in FF so you know how it works in a vanilla FF. In general, it may be a good idea to inform users (before they log in) that a new window appears, because I would think popup blocking software informs the user that a popup has been blocked, and would they like to view it? If they expect a new window before hand, then it may be trivial for them to say Yes to that popup.

Though if your client is selling products or wants people to use an online app, it needs to be the fewest amount of work for the visitor. Similar to online sellers trying to get the product in front of the visitor with the fewest number of clicks on their part.

and until we make it live we won’t get the feedback.

I just got this book… Rocket Surgery Made Easy by usability expert Steve Krug (the guy who wrote Don’t Make Me Think!). The book is about dirty/cheap usability testing for the rest of us, who don’t spend a bazillion euros on some usability expert to come along and say our app is crap. He states repeatedly over and over, test early and often. Our intuition is to wait til there’s actually something working, something to test. He says it’s BAD intuition. Test sooner than you think you want to. It’s easier to change stuff before building it all. If your testing showed users were getting blocked from the app, the client may demand that you do it completely differently… and you’d rather get that demand in the beginning instead of after spending all that time building it.

If this is more of an internal app, well, the users won’t have a choice anyway : ) muhahahahaha… you can afford to be more evil then.

well i did my part of window open. whereas popup are concered that is of other dev work. which i want him to get it trouble for being over clever and cutting me out :slight_smile:

what if i wanna pass in more than 3 parameters? as folks here said it can only pass 3 parameter? basically what i want is no to all e.g menubar,toolbar,location. is there any shortcut to write no to all?

As Paul already said, all those things you listed count as the third parameter, and simply are all enclosed in ONE set of "

window.open(“home.php”,“_blank”,“toolbar=no,location=yes,directories=no,status=no,menubar=no,scrollbars=no,resizeable=no,copyhistory=yes, width=1280, height=800”);
And as mentioned before, you may want to adjust the width and height to accommodate browser chrome.

For example if I’m making a min-width screen of 800px, I actually set it to 760px, which we can call “800-friendly”. It may still be too small for someone with one of those goofy menu thingies on the side of the browser (I hate them but other people have them open regularly) but it’ll cover most people with a scrollbar and some add’l stuff most of the time.

So your 1280, if you want 1280 to fit on some screen (and of course it won’t fit on all screen anyway, may be too small of a screen!) then try 1240 or so instead.

I don’t know if there’s a shortcut, but if there were multiple calls to this function then I suppose they could be pre-defined somewhere else in a var.

*edit I don’t know why there are spaces in my “resizeable” but they’re certainly not that way in my edit!