I’ve been trying for hours to make fancybox to load a php file, with no success…
Here’s the details:
You can visit the website having the problem here. Fancybox request is called when you click either “Παλαιά Δημοτικά Λουτρά” or “Αρχαίο Ωδείο”, next to each image.
First, page’s content is loaded through an ajax request. This page contains the link:
<a class="area_fancybox" href="http://www.mysite/fancy_areas.php?areasName=' . $the_area . '">' . $the_area . '</a>
Where $the_area variable is the parameter I want to pass to the php file that fancybox will load. Now when page’s content has loaded, I add the fancybox code, like this.
jQuery('#diethnes_festival_2012').load('../../../diethnes_festival_2012.php', function() {
jQuery("a.area_fancybox").fancybox();
});
When you click “area_fancybox” link, fancybox starts loading, but nothing happens…
Any help will be very appreciated.
Fancyboxajax call requests from url starting withwwwwhile your link doesn’t have this part. If you load your page withwww.at the begining then the call works.This is due to the
allow-control-access-policyof the browsers. Always usefirebugorchrome developer toolsto look for errors in console.