title: Check function inside an inframe function
body: <p>I want to execute a function to update inside an <code>iframe</code> click script</p>
  
  <pre><code>&lt;script&gt;
      var monitor = setInterval(function() {
          var elem = document.activeElement;
          if (elem &amp;&amp; elem.tagName == 'IFRAME') {
              message.innerHTML = 'Clicked'
              // here ajax execute, but doesn't work, it loads the whole script without clicking it.
              clearInterval(monitor);
          }
      }, 100);
  &lt;/script&gt;
  
  &lt;div id="framerefresh"&gt;
      &lt;iframe rel="nofollow" src="adsense.htm" id="iframe" name="frame1" scrolling="no" frameborder="no" align="center" height = "250px" width = "300px"&gt;&lt;/iframe&gt;
      &lt;div id="message"&gt;&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I really, really need some help with this. I want to run an update query when a click occurs inside the iframe.</p>