Trying to reload a div with dynamic content from main page when closing a fancybox
Hello,
I'm trying to reload a div on a main page when I edit the dynamic content in a fancybox.
The main page is made of an included php files. I thought I would be able to reload it:
html on main page:
<div class="contact_ct">
<h1><? echo "$text_title_cttech"; ?></h1>
<a href="admin_contact_e.php?id=<? echo "$id_ct_tech"; ?>" class="edit_ct">
<img src="img/but_edit.png" class="imgedit"></a>
<? include("admin_inc_admin_inc_ct.php"); ?>
</div>
Javascript:
$(".edit_cf").fancybox({
'width'
: 370,
'height'
: 470,
// 'onClosed': function() {
// //
//parent.location.reload(true);
//
//$("#contact_ct").hide();
//
//$('.contact_ct').replaceWith($('.contact_cf'));
//
//$('.contact_cf').replaceWith($('.contact_ct'));
// }
'hideOnContentClick' : false,
'callbackOnClose':function() {
$('#result').load('admin_inc_admin_inc_ct.php');
}
});
admin_inc_admin_inc_ct.php
<div class="contact_data">
<ul>
<li><? echo $text_info_name?>: <? echo $nom_ct?></li>
<li><? echo $text_info_adress?>:<? echo $adress_ct?></li>
<li><? echo $text_info_zcp?>:</span> <? echo "$zip_ct $ville_ct $pays_ct"; ?></li>
<li><? echo $text_info_email?>:<? echo $email_ct?></li>
</ul>
</div>
I also tried the replaceWith function but it didn't work....
I don't know what to do to make it work.