php - Jquery does not work on panel which had content dynamically added -
i have page have panel, works popup when user clicks button. content of panel taken php file. need jquery
work inside panel, unfortunately not happening.
i tried adding on top of php file request made:
<script type="text/javascript"> $(document).ready(function(){ window.alert("testing"); }); </script>
so when panel update "testing" should come on screen.
i tried attach events button on panel, main php file, didn't work.
how can make jquery
work on panel?
how adding content panel:
function getclink(strcl,strcls) { var xmlhttpcl; if (strcl=="") { document.getelementbyid("dividclink").innerhtml=""; return; } if (window.xmlhttprequest) {// code ie7+, firefox, chrome, opera, safari xmlhttpcl=new xmlhttprequest(); } else {// code ie6, ie5 xmlhttpcl=new activexobject("microsoft.xmlhttp"); } xmlhttpcl.onreadystatechange=function() { if (xmlhttpcl.readystate == 4 && xmlhttpcl.status == 200) { document.getelementbyid("dividclink").innerhtml=xmlhttpcl.responsetext; //alert(xmlhttp.responsetext); } } xmlhttpcl.open("get","get_close_link_details.php?cl="+strcl+"&cls="+strcls,true); xmlhttpcl.send(); }
i use jquery ajax call , call alert after content has loaded. this
$('#clicktopopup').click(function(){ $.get('url', function(data){ $('#whereyouwanthtml').html(data); alert("testing"); }); });
although if doing dialog popup use jquery ui.
Comments
Post a Comment