Enjoy an ad free experience by logging in. Not a member yet?
Register .
01-21-2003, 07:40 PM
PM User |
#1
New Coder
Join Date: Nov 2002
Location: CT
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Popup Window
How can I link an HTML webpage and have it open in a simple popup window?!?!?!
MAtt -
01-21-2003, 07:51 PM
PM User |
#2
Regular Coder
Join Date: Jan 2003
Posts: 867
Thanks: 4
Thanked 8 Times in 8 Posts
<a href="javascript
:onclick(window.open('yourpage.htm'))">link text</a>
edit: take out the space in java script
Go here for more options:
http://developer.irt.org/script/90.htm
Last edited by arnyinc; 01-21-2003 at 07:57 PM ..
01-21-2003, 07:57 PM
PM User |
#3
Senior Coder
Join Date: Aug 2002
Posts: 3,467
Thanks: 0
Thanked 0 Times in 0 Posts
My preferred method
Code:
<a href="somepage.htm" target="sometarget" onclick="window.open(this.href, this.target, features ); return false;">link</a>
Last edited by beetle; 01-21-2003 at 10:11 PM ..
01-21-2003, 07:58 PM
PM User |
#4
Regular Coder
Join Date: Jan 2003
Posts: 867
Thanks: 4
Thanked 8 Times in 8 Posts
Go with beetle's suggestion. It looks like it is more backwards compliant.
01-21-2003, 08:08 PM
PM User |
#5
Senior Coder
Join Date: Aug 2002
Posts: 3,467
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally posted by arnyinc
Go with beetle's suggestion. It looks like it is more backwards compliant.
And search engine friendly, too
01-21-2003, 09:26 PM
PM User |
#6
New Coder
Join Date: Nov 2002
Location: CT
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Popup Window
Beetle: I not clear on the end part of the popup window code you gave me:
(this.href, this.target, features);">
Is this.href and this.target the same source as "somepage.htm" and "sometarget"? And what is features. Can you throw together a quick example. Thanks in advance!
Matt -
01-21-2003, 09:38 PM
PM User |
#7
New Coder
Join Date: Nov 2002
Location: CT
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Popup Window
I get what the features are: toolbar, size, etc, but I didn't get that to work. I did get the window to open in a popup though.
Matt -
01-21-2003, 09:38 PM
PM User |
#8
Senior Coder
Join Date: Aug 2002
Posts: 3,467
Thanks: 0
Thanked 0 Times in 0 Posts
features is a comma separated string of window features. The most common features are (with their datatype)
width: integer
height: integer
top: integer
left: integer
location: boolean
menubar: boolean
scrollbars: boolean
status: boolean
toolbar: boolean
The width, height, top and left all pertain to the popup's size and position. All the rest of these features are literally window features
location - the address bar
menubar - File Edit View etc...
scrollbars - duh
status - the statusbar at the bottom of the window
toolbar - The back, foward, home, etc buttons
Now, by default, all the window features are off, or have a false value, so you only need to include those which you want to be true.
window.open( this.href, this.target, 'width=300, height=200, top=100, left=100, status=1, scrollbars=1, toolbar=1');
This opens a 300x200 window, positioned at 100,100 with the statubar, scrollbars, and the toolbar.
01-21-2003, 10:02 PM
PM User |
#9
New Coder
Join Date: Nov 2002
Location: CT
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Popup Window
Beetle:
How do I list the target? I have it as target="_blank", but what about the this.target. What do I do with that?
Here's my current code:
<a href="case.html" target="_blank" onClick="window.open(case.html),'height=300, width=300, top=100, left=100, status=1, scrollbars=1, toolbars=1';">link</a>
Matt -
01-21-2003, 10:10 PM
PM User |
#10
Senior Coder
Join Date: Aug 2002
Posts: 3,467
Thanks: 0
Thanked 0 Times in 0 Posts
<a href="case.html" target="_blank" onClick="window.open(this.href, this.target,'height=300, width=300, top=100, left=100, status=1, scrollbars=1, toolbars=1'); return false;">link</a>
01-21-2003, 10:19 PM
PM User |
#11
Regular Coder
Join Date: Jun 2002
Posts: 166
Thanks: 0
Thanked 0 Times in 0 Posts
If concerned with older Netscape browsers, don't use spaces between the window parameters.
Jump To Top of Thread
Thread Tools
Rate This Thread
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
All times are GMT +1. The time now is 12:09 AM .
Advertisement
Log in to turn off these ads.