Search code examples
javascriptiframeclickdetection

JavaScript: Detection of a link click inside an iframe


How to detect user's click on the link inside the iframe using JavaScript?


Solution

  • You are able to check iframe load event

    onLoad="alert(this.contentWindow.location);"
    

    or on jquery:

    $('iframe#yourId').load(function() {
      alert("the iframe has been loaded");
    });