Click here to Skip to main content
15,888,313 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi Guyz,

I have scenraio like in one of my Page, iFrame is being loaded, over that iFrame I need to bind a click event using jQuery, for that I have tried below code:
JavaScript
$j('.ms-dlgFrame').load(function(){
  $j('.ms-dlgFrame').contents().find('a [title="Browse"]').bind('click', function(){
    console.log('Frame Loaded');
    setTimeout(function(){ 
	console.log('Function Loaded after Timerout');
    $j('.ms-dlgFrame').each(function(){
      $j(this).contents().find('#resultcontent').css('height','200px'); 
	  $j(this).contents().find('#MetadataTreeControlTreeSearch').css('height','200px');
	   });
    },5000);
  });
});


but there was not luck. I could not get the click event fired. Tried lot of tricks to achieve but did not work for me. Any help over how to bind a click event of iFrame element using jQuery would be much appreciated.
Posted
Updated 19-Nov-14 0:21am
v4

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