Forum Moderators: open
However, you could set a document cookie with Javascript, and the next page **could** read that value and react accordingly.
var clicked=false;
onclick=increment();
function increment() {
clicked=true;
(...set cookie code ...)
}
Then on page 2,
clicked = (... read cookie ...)
if (clicked==false) { action; }
else { other action ; }
it is possible if you use window.open like this...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>if...else</title><meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
<script type="text/javascript">
//<![CDATA[var check="true";
function doThisOrThat() {
if(check=="true") {
window.open("http://www.webmasterworld.com/","","left=200,top=200,width=400,height=400");
check="false";
}
else {
alert("this button has already been clicked")
}
}//]]>
</script></head>
<body><form action="#">
<div>
<input type="button" value="the button" onclick="doThisOrThat()"/>
</div>
</form></body>
</html>
birdbrain
<html>
<head>
<title>newwin</title>
<script language="JavaScript">
function newWin() {
var ww,wh,params,win;
ww = (screen.width)?parseInt(screen.width*.75):400; // always a default
wh = (screen.height)?parseInt(screen.height*.5):300;
params = 'width='+ww+',height='+wh;
win = open('','tstwin',params);
}
</script>
</head>
<body>
<a href="#" onClick="newWin();">new window</a>
</body>
</html>
You could do a similar thing to set the window position.