I'm trying to get a link to open in a new window, but so far the best I could do is get it to open in a new tab by setting target="_blank" in the <a> tag. How can I get a link to open in a new browser window and also specify the length and width of the new window?
Even with JavaScript you can't guarantee where it will open. Also the size and location options you can specify for JavaScript are just suggestions that the browser can ignore.
The only way to be certain that a page will open in a new window is when you are the one opening it - you right click on the link and select "new Window".
Even with JavaScript you can't guarantee where it will open. Also the size and location options you can specify for JavaScript are just suggestions that the browser can ignore.
The only way to be certain that a page will open in a new window is when you are the one opening it - you right click on the link and select "new Window".
While that may be true on the technical side, no user will want to manually open a new window.
While that may be true on the technical side, no user will want to manually open a new window.
How do you know that?
In fact, target="_blank" was removed from the HTML 4 specification because the tenor was that people shouldn’t be forced a new window/tab but should be able to decide for themselves how they would open links. And I do know people who actually do this (you can also Shift-click a link to open a new window or Ctrl/Cmd-click to open a new tab).
Good question. I guess I was just speaking for myself (and my boss). Personally, if a link says (or implies) that it will open in a new window, I don't want to have to do extra work to get it to do what it promises. But if that is not your view of it, no problem. We can agree to disagree.
Thing is that most links don’t say that they are opening in a new window. Take Wikipedia for example. External links have an icon but it only says that this link will lead away from Wikipedia, it doesn’t say it opens in a new window. And (luckily, in my opinion) it’s up to the user to decide. I wouldn’t want every external link to open in a new window/tab (but this time I can only speak for myself either).
I’m not saying that this couldn’t be useful at times but it’s not the norm for the average website.
I’m not saying that this couldn’t be useful at times but it’s not the norm for the average website.
You're absolutely right about that. I am just using it for a specific application. In my online store (where we sell t shirts) I have a link in all the shirt descriptions that links to a sizing chart. It just made more sense to have this pop up because the user would just take a single quick glance to figure out what size they want and not look at it anymore.