0

I have a div whose content is refreshed through AJAX upon a button click. The function is on every of my pages, so I put the javascript and the generating PHP into http://mydomain.net/foo.js and http://mydomain.net/foo.php, resp.

This works fine for pages in my main domain, but when I try to add the functionality for pages in http://subdomain.mydomain.net nothing is written. I'm pretty sure the cause is that foo.js and/or foo.php are not in the subdomain.

Is there a way to make this work in all my subdomains without having it to copy each time? Probably in .htaccess?

stevenvh
  • 2,971
  • 9
  • 41
  • 54
  • Did you try looking at your JavaScript error console? And then searching Google for the error message? – Quentin May 01 '14 at 13:39
  • A simple way to solve this is to use a 'traffic script'. Place `traffic.php` in your domainfolder, pass `foo.php` as parameter trough the ajax call and just use `include(parameter)` in the traffic script. – Michel May 01 '14 at 13:49
  • 2
    @Michel nothing beats the good old "traffic.php?file=/etc/passwd" trick... ;-) – DoXicK May 01 '14 at 13:51

0 Answers0