jQuery variable undefined with php include
16:13 13 Jun 2015

I am trying to use a variable in jQuery which is included with PHP, the attr rel of the img in footer.

I try to use it to change the attr src in that same img in footer.

if I use it without include, then it works. But with include it doesn't.

I always get ../img/undefined.svg as a result.

How can I get it to be ../img/facebook.svg or ../img/twitter.svg?

In my php-file I use:



In header.php is JavaScript, jQuery and html:

    
 



In footer.php is just html:

    
php jquery html