jQuery show ax external PHP page in a DIV -
jQuery show ax external PHP page in a DIV -
possible duplicate: how show page div jquery
hello have div in page index.html:
<div id="form"></div>
now need way jquery show page within div. page need phone call , load there contact.php simple html + php contact form. there way load jquery contents of contact.php within index.html page div is?
please remember contact.php page contains javascript codes must working. propably jquery.load function not work in case.
thanks help!
try this:
$.get("contact.php", function(data){ $("#form").html(data); });
if contact.php total page (including <html>
), should consider loading in <iframe/>
.
edit if $.get
not work above, seek this:
$.get('example.html', function(data) { var $page = $(data); $page.filter('script').add($page.find('script')).each(function(){ $.globaleval(this.text || this.textcontent || this.innerhtml || ''); }); $('#form').html(data); } });
if $.get
works .load
, script ignored. code we're forcing them executed.
hope helps. cheers
php jquery
Comments
Post a Comment