javascript - How to include html file on click link -


hi want include file on link click here following code did not working in html page

here code given below

    $("#reset").click(function() {           $(function() {               $("#rightpanecontainerdiv").html('<iframe src="open.php"></iframe>');           });     });      <a href="#" id="reset"></a> 

where wrong in following code

how can achieve output

you binding javascript handler link before including link in html.

after click event fires, delaying reaction until dom ready — highly unlikely dom not ready time link clicked.

swap 2 event handlers.

wait dom ready. bind event handler.

$(function() {     $("#reset").click(function() {         $("#rightpanecontainerdiv").html('<iframe src="open.php"></iframe>');     }); }); 

Comments

Popular posts from this blog

javascript - how to protect a flash video from refresh? -

android - Associate same looper with different threads -

visual studio 2010 - Connect to informix database windows form application -