Small HTML query
Author
Discussion

vixpy1

Original Poster:

42,699 posts

295 months

Thursday 1st March 2007
quotequote all
How does one get a link to open in a new page of a specified size?

i know its to do with the 'target' tag, but its been so long since i've done any of this my head is about to fall off.

BaconBonce

579 posts

266 months

Thursday 1st March 2007
quotequote all
target="_blank" after the href bit from memory

UncleDave

7,155 posts

262 months

Thursday 1st March 2007
quotequote all
Yep it's the _blank bit as above..
but there is no way to control the size of the window you open unless you use Javascript..

Bodo

12,621 posts

297 months

Thursday 1st March 2007
quotequote all
You'll need javascript to specify the size.

Bodo

12,621 posts

297 months

Thursday 1st March 2007
quotequote all
UncleDave said:
Yep it's the _blank bit as above..
but there is no way to control the size of the window you open unless you use Javascript..

whippersnapper!

Altrezia

8,742 posts

242 months

Friday 2nd March 2007
quotequote all

tigger1

8,478 posts

252 months

Friday 2nd March 2007
quotequote all
Bodo said:
You'll need javascript to specify the size.

Pervert.

Jacascript...eeew.

jamieboy

5,931 posts

260 months

Friday 2nd March 2007
quotequote all
tigger1 said:
Bodo said:
You'll need javascript to specify the size.

Pervert.

Jacascript...eeew.
Happy to hear alternatives? ears

tigger1

8,478 posts

252 months

Friday 2nd March 2007
quotequote all
jamieboy said:
tigger1 said:
Bodo said:
You'll need javascript to specify the size.

Pervert.

Jacascript...eeew.
Happy to hear alternatives? ears

Yes...but Javascript. Work of the devil.

Bodo

12,621 posts

297 months

Friday 2nd March 2007
quotequote all
I must be the devil's pervert then

Code for the smilies legend popup, ripped from the Post Reply source code:
<!--
function openWindow(url) {
popupWin = window.open(url, 'new_page', 'width=450,height=400,scrollbars=yes')
}
// -->
then
<a href="Javascript: openWindow('h ttp://ww w.pistonheads.com/gassing/legend.htm')" target="_self"><small>Smiles legend</small></a>


(remove blanks from url)

Edited by Bodo on Friday 2nd March 10:17

J_S_G

6,177 posts

281 months

Friday 2nd March 2007
quotequote all
tigger1 said:
jamieboy said:
tigger1 said:
Bodo said:
You'll need javascript to specify the size.

Pervert.

Jacascript...eeew.
Happy to hear alternatives? ears

Yes...but Javascript. Work of the devil.

You could write a nice little bit of script that parsed an HTML document looking for anchor tags with specific targets/custom attributes/let you just define the data in an XML island somewhere/etc, having this script then take "normal" anchors that open with a "_blank" (or named) windows, and change them to fixed-size (menu/tool-bar-less) popups. Accessible, guaranteed to work on every browser, gives the experience you want to upstream browsers, search-engine-optimisation friendly, graceful degradation, etc.

zaktoo

805 posts

238 months

Friday 2nd March 2007
quotequote all
You could always assume that the user would resize the window himself, should he want to. Bugs the crap out of me when web sites assume what size *I* want *my* windows to be....

Bodo

12,621 posts

297 months

Friday 2nd March 2007
quotequote all
zaktoo said:
You could always assume that the user would resize the window himself, should he want to. Bugs the crap out of me when web sites assume what size *I* want *my* windows to be....



FFS!

J_S_G

6,177 posts

281 months

Friday 2nd March 2007
quotequote all
zaktoo said:
You could always assume that the user would resize the window himself, should he want to. Bugs the crap out of me when web sites assume what size *I* want *my* windows to be....

As a techie at heart, I agree (but you should just disable that in the JavaScript config dialog, then).
As a business person, I don't agree. There are good business cases for guiding the average (dumb) user in the way that you want - adding black ink to the books through a process that is more aligned to the "average" user than the "exceptional" user is going to suit most businesses!