Is it possible to store a WordPress php tag into a variable in a JavaScript file? I tried this below but couldn't get it to output anything.
jQuery(document).ready(function($){
// Fade in Contact background
var imagePath = '<?php bloginfo("template_url"); ?>/img/';
$('body.page-template-page-contact #content').css('background', 'url(imagePath + bg-contact.jpg) 50% 0% no-repeat fixed').fadeIn(2000);
});