Asked by duncanb7
at 2024-11-18 07:36:14
Point:500 Replies:3 POST_ID:828533USER_ID:11059
Topic:
JavaScript;;Hypertext Markup Language (HTML)
I would like to detect a click on body and report out what the click href link is clicking.
And I write the following example code with using function of onclick="processclick();" on body tag.
But when I click yahoo link or wiki link, the alert() is always report to the exisitng domain name
and path such as http://www.mywebsite.com/onclick.html
So whereever I click on the body area, it always report the same window.location.href whcih
is equal to http://www.mywebsite.com/onclick.html . I expect, it alert() me the yahoo or wiki path name
according to individual click
if possible, I can prevent my vistors going into
yahoo or wiki link by redirect into other link when they click the either link , this
is for example only.
How can I detect the yahoo or wiki click and its exact link path name by alert() before it load
or jump into www.yahoo.com or www.wiki.com web pages
I tried put onload="processclick();" in body tag, the result is keeping reporting the same
my website path such as http://www.mywebsite.com/onclick.html
How to capture the click event and its exact link path name
Please advise
Duncan
And I write the following example code with using function of onclick="processclick();" on body tag.
But when I click yahoo link or wiki link, the alert() is always report to the exisitng domain name
and path such as http://www.mywebsite.com/onclick.html
So whereever I click on the body area, it always report the same window.location.href whcih
is equal to http://www.mywebsite.com/onclick.html . I expect, it alert() me the yahoo or wiki path name
according to individual click
if possible, I can prevent my vistors going into
yahoo or wiki link by redirect into other link when they click the either link , this
is for example only.
How can I detect the yahoo or wiki click and its exact link path name by alert() before it load
or jump into www.yahoo.com or www.wiki.com web pages
I tried put onload="processclick();" in body tag, the result is keeping reporting the same
my website path such as http://www.mywebsite.com/onclick.html
How to capture the click event and its exact link path name
Please advise
Duncan