/    Sign up×
Community /Pin to ProfileBookmark

Question regarding user verification before opening a link

when this code is executed two links, one going to the Microsoft site and the other going to the Netscape site are brought up. after the link is clicked the user is asked “Do you want to visit Microsoft site” or “Do you want to visit Netscape site”. after confirmation the user is transferred to one of the sites. i can’t get the confirmation box to pop up. does anyone have any ideas? thanks! ?

here is the code:

<html>
<head>
<script language=”javascript” type=”text/javascript”>
<!–

var newur1
function CheckRequest(newur1)
{
if (confirm(“Do you want to visit ” + newur1 + ” site.”))
{
return true
}
else
{
return false
}
}

//–>
</script>
<title>Capturing Links</title>
</head>
<P><A href=”http://www.microsoft.com” onclick = “return
CheckRequest(‘Microsoft’)”>Microsoft</A></P>
<P><A href=”http://www.netscape.com” onclick = “return
CheckRequest(‘Netscape’)”>Netscape</A></P>
</body>
</html>

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@CrazyMerlinJan 14.2006 — [CODE]
<html>
<head>
<script language="javascript" type="text/javascript">
<!--

var newur1;
function CheckRequest(newur1){
if (confirm("Do you want to visit " + newur1 + " site."))return true;
else return false;
}

//-->
</script>
<title>Capturing Links</title>
</head>
<P><A href="http://www.microsoft.com" onclick = "return CheckRequest('Microsoft')">Microsoft</A></P>
<P><A href="http://www.netscape.com" onclick = "return CheckRequest('Netscape')">Netscape</A></P>
</body>
</html>
[/CODE]


don't forget semicolons!

if unsure whether you need one of not, put one.
Copy linkTweet thisAlerts:
@fuzion79authorJan 14.2006 — thanks merlin?
Copy linkTweet thisAlerts:
@fuzion79authorJan 14.2006 — hm...tried it with the semicolons, but still nothing. i followed your modification.
×

Success!

Help @fuzion79 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.27,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...