specify window size w/out using js?

liunx

Guest
Is it possible to use HTML to open a new window (ie: target="_blank") and also specify the window size (ie: height=600 & width = 400)? I know it's possible using javascripts (ie: open a popup window) but was hoping I could do it easily w/ HTML instead.<br />
Any ideas?<br />
Thanks,<br />
sb<!--content-->Sorry Shelly, can't be done that I know of just using HTML code. You have to use a little bit of javascript to do it. You can put it right into the HTML tag, something like this:<br />
<br />
<a href=http://www.htmlforums.com/archive/index.php/"#" onclick="window.open('your_url_here','mywindow','width=450,height=300,toolbar=no,location=no,directories=no,s tatus=no,menubar=no,scrollbars=yes,copyhistory=yes,resizable=yes')"> Click Here</a><!--content-->Wow Kevin - thanks. I know I'm butting in here, but I was looking around for something like this myself for the last couple weeks! :) I'm always so glad when I pop in here; really have to do it more often again!<!--content-->Kevin,<br />
Thanks! I do think I'm missing something because it's opening a new window AND changing the current window to that link. <br />
<br />
<a href=http://www.htmlforums.com/archive/index.php/"#" onclick="window. open('your_url_here','mywindow','width=450,height=300,toolbar=no,location=no,directories=no,status=n <br />
<br />
I changed the 'your_url_here' to the URL for the new window but did nothing to 'mywindow'<br />
<br />
I tried many other combinations and none of them worked the way I wanted to (which is to have my current window stay the same & the popup to be a new URL).<br />
Help!<br />
TIA,<br />
Shelly.<!--content-->well you can't pick a size with just plain html. I used <br />
<a href=http://www.htmlforums.com/archive/index.php/"mysite.com" target="new-window">link</a><br />
<br />
that will make it the size of the default on the users machine.<!--content-->If you want it to be a pop-up, you need to use a pop-up command to activate it. Here's one method:<br />
<br />
<br />
<script><br />
window.open('http://www.site.com','biz','width=500,height=500')<br />
</script><br />
<br />
<br />
You can also put the other window attributes after height by using commas.<!--content-->Originally posted by shellyblake <br />
Kevin,<br />
Thanks! I do think I'm missing something because it's opening a new window AND changing the current window to that link. <br />
<br />
<br />
<br />
I changed the 'your_url_here' to the URL for the new window but did nothing to 'mywindow'<br />
<br />
I tried many other combinations and none of them worked the way I wanted to (which is to have my current window stay the same & the popup to be a new URL).<br />
Help!<br />
TIA,<br />
Shelly. <br />
<br />
<br />
There's a typo there. There should not be a space between window. open. It should be window.open<!--content-->jason,<br />
i think that was a typo on my cut & paste.<br />
my real issue is why it is opening that URL in my current window as well as opening the popup w/ that URL. am i putting the right information in the right places?<br />
what info goes in 'your_url_here' & what info goes in 'mywindow' <br />
thanks,<br />
sb<br />
p.s. not looking to put in js - i've done that before - i was looking for something better than 'target="_blank"' because the new URL (popup) would look better if i can specify the window size.<!--content-->well slap me silly & call me a cab! i'm just full of assumptions today! thank you SO much Kevin for that original code. I figured out what I was doing wrong! I put the popup URL in two places - where you put a # & where it said "put_URL_here". That # should have stayed a #!!!<br />
Is it Monday? No, wait, it really is Tuesday, durnit I wish it were Friday! I need a drink!<br />
sb<!--content-->Originally posted by Jason <br />
<br />
<br />
<br />
There's a typo there. There should not be a space between window. open. It should be window.open <br />
<br />
hmmm....you're right Jason, but for reason the board is adding that space (I guess so the code is not active?), in my cut and paste code in the text file on my computer there is no space... let my try that again and see what happens:<br />
<br />
<br />
<a href=http://www.htmlforums.com/archive/index.php/"#" onclick="window.open('your_url_here','mywindow','width=450,height=300,toolbar=no,location=no,directories=no,s tatus=no,menubar=no,scrollbars=yes,copyhistory=yes,resizable=yes')"> Click here</a><!--content-->yep, the board is adding the space. Will note that for future posts, thanks.<!--content-->Originally posted by shellyblake <br />
well slap me silly & call me a cab! i'm just full of assumptions today! thank you SO much Kevin for that original code. I figured out what I was doing wrong! I put the popup URL in two places - where you put a # & where it said "put_URL_here". That # should have stayed a #!!!<br />
Is it Monday? No, wait, it really is Tuesday, durnit I wish it were Friday! I need a drink!<br />
sb <br />
<br />
hehehe.... I won't slap ya but the cab is on the way :P<br />
yur welcome...<br />
<br />
Kevin<!--content-->
 
Back
Top