register events in iframe

Hi.
Im building a little application that includes an Iframe and a "redirect if no activity" script.

The redirect works at planned.
The timer starts counting on load, and keeps counting until any mouseevent occures.
If the mouse moves, the timer resets to zero.

I now have an Iframe that shows an external website.
My problem is, that when the mouse moves within the iframe, the counter does not register any events

How can I make my script monitor the Iframe?
I cannot edit the iframe content, as the emebbed site is not mine.


<head>
<script language="javascript">
                  var timer=null;
                  var sessTimeOut=10;
                  window.onload=function(){
                        if (document.addEventListener){
                              document.addEventListener("mouseover", clickHandler, true);
                              document.addEventListener("keypress", clickHandler, true);
                              document.addEventListener("click", clickHandler, true);
                        }else if(document.attachEvent){
                              document.attachEvent("onmouseover", clickHandler);
                              document.attachEvent("onclick", clickHandler);
                              document.attachEvent("onkeypress", clickHandler);
                        }
                        timer=setInterval("generateTimer()",1000);
                  }

                  function generateTimer(){
                        var o=document.getElementById('sessTimer');
                        o.value=parseInt(o.value)+1
                        if(o.value>sessTimeOut){
                              clearInterval(timer);
                             var link = "forside.asp";
window.location.href= link;
                        }
                  }

                  function clickHandler(e){
                        var o=document.getElementById('sessTimer');
                        o.value="0";
                  }
            </script>
</head>

<body>
<input type="text" value="0" id="sessTimer">
<table width="1360" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td bgcolor="#FFCCFF">&nbsp;&nbsp;<a href="forside.asp">Hjem</a></td>
  </tr>
  <tr>
    <td background="images/layout/loading.png" style="background-repeat:no-repeat;background-position:center">
<iframe border="0" height="748" width="1360" align="left" allowtransparency="yes" designmode="on" frameborder="0" name="IFRAME"  src="http://www.google.com">
  <p>Your browser does not support iframes.</p>
</iframe>
</td>
  </tr>
</table>
</body>

Open in new window

bsitAsked:
Who is Participating?
 
Ted BouskillConnect With a Mentor Senior Software DeveloperCommented:
No sorry.  You can't track any activity outside the client area for your web page.  That is to protect the client.
0
 
Ted BouskillSenior Software DeveloperCommented:
It can't be done.  The IFRAME is a Window into another web site and the web site in the IFRAME is receiving the events.
0
 
bsitAuthor Commented:
Thats what I have read as well.
But is there really no way I can workaround this issue?

It doesn't have to be with event registering. It could be something with "if any useractivity is registered on the computer, my page will react.
0
Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

 
bsitAuthor Commented:
ok :-(
0
 
bsitAuthor Commented:
How do I close this question?
0
 
Ted BouskillSenior Software DeveloperCommented:
Sometimes the correct answer is 'You can't do that' so select comment http:#30681086 as the answer.
0
 
bsitAuthor Commented:
Unfortunally no solution for this question.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.