Making a link clickable only once

G

Guest

Is there a way in FrontPage to make a hyperlink on a site clickable only
once? I am in the process of creating a site and a link that will be used
accesses another application that sometimes loads slowly. I am trying to
devise a way to ensure that the link can only be clicked one time (so as not
to make the loading even slower). Is this possible, and if so, how?
 
T

Trevor L.

Harvey said:
Is there a way in FrontPage to make a hyperlink on a site clickable
only once? I am in the process of creating a site and a link that
will be used accesses another application that sometimes loads
slowly. I am trying to devise a way to ensure that the link can only
be clicked one time (so as not to make the loading even slower). Is
this possible, and if so, how?

My thoughts are:

Change
<a href = "newpage.html">New Page</a>
to
<a href = "#" onclick=callpage('newpage.html')">New Page</a>
And write a script for callpage()
e.g.
var pageflag= false
function callpage(url){
if (!pageflag) location.href=url
pageflag = true
}

This is some code I tried. It calls the second page, but I can't try calling it again as it loads immediately.

<html>
<head>
<script type="text/javascript">
var pageflag= false
function callpage(url){
if (!pageflag)
{ location.href=url
alert(url + ' called. Please wait.' )
pageflag = true
}
else alert(url + ' has already been called. Please keep waiting.' )
}
</script>
<head>
<body>
<a href="#" onclick="callpage('newpage.html')">New Page</a>
</body>
</html>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top