What's the HTML tag for opening a new, smaller window? ...and how do i specifiy the new size or whatever? Thanks
Printable View
What's the HTML tag for opening a new, smaller window? ...and how do i specifiy the new size or whatever? Thanks
window.open("something.html", "name", "toolbar,status,height=HEIGHT,width=WIDTH");
etc etc etc
so it's javascript?Quote:
Originally posted by morrowasted
window.open("something.html", "name", "toolbar,status,height=HEIGHT,width=WIDTH");
etc etc etc
Yes it's JavaScript.
If you don't want to use javascript for some reason, you can use a hyperlink and make its target property "_blank".
But then you have no control over size or position, etc.
alright, sorry fellas...i'm new to js
If you need help implementing it, just ask.
how dare you read my mind!? ...anywho, how do i implement it into an html doc or what do i have to do...you get the idea. thanks a lot.Quote:
Originally posted by Acidic
If you need help implementing it, just ask.
erm...
<a onclick="window.open('something.html', 'name', 'toolbar,status,height=HEIGHT,width=WIDTH');" href="#">
or
<script>
function MakeWindow(){
window.open('something.html', 'name', 'toolbar,status,height=HEIGHT,width=WIDTH');
}
<script>
and
<a onclick="MakeWindow()" href="#">
you are the man. exactly what i needed. thanks!Quote:
Originally posted by morrowasted
erm...
<a onclick="window.open('something.html', 'name', 'toolbar,status,height=HEIGHT,width=WIDTH');" href="#">
one thing though...here's the exact line i use:
but it opens the link in the same window as well as opening it in the new oneCode:<a onclick="window.open('contacts.html', 'Contacts', 'toolbar,status,height=500,width=500');" href="contacts.html">Contact Us</a>
you dont need the href in there, you are telling it to open the popup aswell as the page as a normal hyperlink. Change to:
Code:<a onclick="window.open('contacts.html', 'Contacts', 'toolbar,status,height=500,width=500');">Contact Us</a>
k, much thanks
Better yet, change it to
<a onclick="window.open('contacts.html', 'Contacts', 'toolbar,status,height=500,width=500'); return false" href="contacts.html">Contact Us</a>
This way, there's a popup in JavaScript-enabled browsers and a normal link in others, so you avoid locking people out.
sweet. thanks. i have seen that return statement before, but wasn't sure about what it does.Quote:
Originally posted by CornedBee
Better yet, change it to
<a onclick="window.open('contacts.html', 'Contacts', 'toolbar,status,height=500,width=500'); return false" href="contacts.html">Contact Us</a>
This way, there's a popup in JavaScript-enabled browsers and a normal link in others, so you avoid locking people out.
It prevents the browser from doing any default action following the event. In the case of a link this means following the link.
you know, i like this JS stuff. it's pretty simple and makes the interface more user-friendly and all that, but it has a few bugs when moving from browser to browser. i have heard that this is why many people have moved to perl. what do you think about this?Quote:
Originally posted by CornedBee
It prevents the browser from doing any default action following the event. In the case of a link this means following the link.
Nothing. Perl in CGI scripts is a server-side language, JavaScript is client-side. Their purposes are different, as are the things you can do with them. You can't do an image rollover with Perl, and you can't retrieve data from a database with JavaScript.
ah, makes sense. good show.Quote:
Originally posted by CornedBee
Nothing. Perl in CGI scripts is a server-side language, JavaScript is client-side. Their purposes are different, as are the things you can do with them. You can't do an image rollover with Perl, and you can't retrieve data from a database with JavaScript.