Click here to Skip to main content
15,949,741 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
HI,

i am fresher i got a task in which i have show a website with in a iframe,

my Iframe:
HTML
<iframe src=http://www.makemytrip.com width="900" height="900"> </iframe>


now the thing is how i got to know user clicked on which button or on which link, i want the information to be stored on some file. just want the click information...


any help would be appreciated.
Posted
Updated 3-Oct-13 23:39pm
v2

I don't have exact idea but i can help you this way

JavaScript
$(document).ready(function() {
    $("a").click(function() {
        alert(this.id);
// here you will get which link have been clicked
    });
});


JavaScript
$(document).ready(function() {
    $("button").click(function() {
        alert(this.id);
// here you will get which button have been clicked
    });
});


Ask me if you don't get it

regards..:)
 
Share this answer
 
@Ankit

i am fresher hardly know about javascript can you please give me the full code so that i can paste and try it. that would be really helpful for me.


C#
 "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>IFrame Clicks</title>
<script type="text/javascript">

</script>
</head>
<body>
<iframe src="http://www.makemytrip.com" width="300" height="300"></iframe>


</body>
</html>


above mentioned is the html code. please revert with your solution...
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900