Click to See Complete Forum and Search --> : one link, two changes


sidthelizard
02-07-2003, 01:56 PM
I'm trying to use a function to open a new window with constrained properties. The problem is every time I select the link, the original page from which the link was selected reverts back to my root directory. Oh how irritating! Below is the function, and then below that the code attached with the link I want in the new constrained window.

<!--

function newWin() {
newWin = window.open("prod/tea.html","newWin"," width=700,height=600,menubar=0,status=0,toolbar=0,directories=0,scrollbar=0,resizable=0");
newWin.focus();
}

//-->

. . . .

<a href="" onClick="newWin();",

Below the anchor I have a piece of roll-over script before I close things off. Can anyone help?

Charles
02-07-2003, 02:25 PM
And you've another, greater problem there that you don't notice. For JavaScript free users (about 10% of all users) your link will do nothing at all. Try:

<script type="text/javascript">
<!--
function newWin(url) {
newWin = window.open(url, "child", "width=700,height=600");
newWin.focus();
return false;
}
// -->
</script>

<a href="prod/tea.html" onclick="return newWin(this.href)">Tea please.</a>