SpongeRob
03-03-2012, 10:13 PM
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Test Project</title>
<script type="text/javascript">
var clicks=0;
function linkClick(){
document.getElementById('clicked').value = ++clicks;
}
</script>
</head>
<body>
<p align="center"><a href="http://www.google.ie" target="_blank" onclick="linkClick()">Google</a></p>
<p align="center"> </p>
<p align="center"><a href="http://www.google.ie" target="_blank" onclick="linkClick()">Google</a></p>
<p align="center"> </p>
<p align="center"><a href="http://www.google.ie" target="_blank" onclick="linkClick()">Google</a></p>
<p align="center"> </p>
<td colspan="3" valign="top">You have clicked my links <input id="clicked" size="1" onfocus="this.blur();" value="0" > times</td>
<Script Language="JavaScript">
if ("clicks">3);
{
window.open('http://ie.yahoo.com','','scrollbars=no,menubar=no,height=600,width=800,resizable=yes,toolbar=no,location=no ,status=no');
}
</Script>
</body>
</html>
I am a complete novice, I've spend most of today trying to research and learn Javascript.
I would like my page to keep a count of how many times the links have been opened (this is happening)
I would like a new pop up window to occur when the count gets to a specif value (this isnt happening) OR maybe to have a new hyperlink to appear that the user can then click on?
Thanks in advance.
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Test Project</title>
<script type="text/javascript">
var clicks=0;
function linkClick(){
document.getElementById('clicked').value = ++clicks;
}
</script>
</head>
<body>
<p align="center"><a href="http://www.google.ie" target="_blank" onclick="linkClick()">Google</a></p>
<p align="center"> </p>
<p align="center"><a href="http://www.google.ie" target="_blank" onclick="linkClick()">Google</a></p>
<p align="center"> </p>
<p align="center"><a href="http://www.google.ie" target="_blank" onclick="linkClick()">Google</a></p>
<p align="center"> </p>
<td colspan="3" valign="top">You have clicked my links <input id="clicked" size="1" onfocus="this.blur();" value="0" > times</td>
<Script Language="JavaScript">
if ("clicks">3);
{
window.open('http://ie.yahoo.com','','scrollbars=no,menubar=no,height=600,width=800,resizable=yes,toolbar=no,location=no ,status=no');
}
</Script>
</body>
</html>
I am a complete novice, I've spend most of today trying to research and learn Javascript.
I would like my page to keep a count of how many times the links have been opened (this is happening)
I would like a new pop up window to occur when the count gets to a specif value (this isnt happening) OR maybe to have a new hyperlink to appear that the user can then click on?
Thanks in advance.