Click to See Complete Forum and Search --> : opening new browswer window


georgeafi
02-16-2003, 12:17 PM
Hey, i put up some script i found on htmlgoodies to open a new browser window on my site without the toolbar and menu bar and afew others. My question is how do you make it into a link? It didn't have an area to do that, but it did have a place to put the url. The reason i know the wasn't a place to put it is because there would atleast be something there for you to see it. And when i viewed my page there was nothing at all. Sorry if i sound confusing. Can someone help? Please?

rellik
02-16-2003, 12:26 PM
erm, can you perhaps post your code plz?

georgeafi
02-16-2003, 12:31 PM
<SCRIPT LANGUAGE="javascript">
<!--
window.open ('www.georgeafi.bravepages.com', 'Miseria Cantare', config='height=100,
width=400, toolbar=no, menubar=no, scrollbars=yes, resizable=no,
location=no, directories=no, status=no')
--></SCRIPT>


It has the url an the page title. I just don't know how to turn it into a link. I haven't worked with html or java very long.

rellik
02-16-2003, 12:47 PM
<html>
<head>
<title>tabular example</title>
<script language="JavaScript">
function openWindow(url,name,features) {
window.open('url','name','features')
}
</script>
</head>

<body>
<a href="#" onClick="openWindow('http://www.georgeafi.bravepages.com','Miseria Cantare','height=100px,width=400px,scrollbars=yes')">
Link text
</a>
</body>
</html>

Charles
02-16-2003, 12:49 PM
<a href="http://www.georgeafi.bravepages.com/" onclick="window.open(this.href, 'child', 'height=100,width=400'); return false">Miseria Cantare</a>

And stay away from those HTML goodies tutorials. They are very bad.

Charles
02-16-2003, 12:55 PM
rellik's example is wrong on three accounts.

1) The "language" attribute of the SCRIPT element waws depricated back in 1997. Use type="text/javascript" instead.

2) A full 10% of users do not use JavaScript and countless more have pop-ups disabled. You need to provide a real value for the "href" attribute so that the page will keep working for those good folks.

3) The "onclick" handler needs to return false to keep the link from activating. In rellik's case the parent window will scroll back to the top of the page.

rellik
02-16-2003, 12:57 PM
ah i see, a nice bit of knowledge for both of us there :D

georgeafi
02-16-2003, 01:05 PM
Awsome, thanks Charles.

Rellik, I tries yours but the size wasn't working. But the one Charles gave deffinently works. Now i can finally start working on the site. I have been look everyehere for that. And i will stop going to HTML goodies. It didn't seem very good anyways.