I have a variable at the end of my PHP document, in the footer. However, because it is template the content of the variable is created in each page differently. Most of the contect of that variable is JS, that looks something like this:
$myVar = '
$(function() {
'.$qTip.'
$(".delDupe").click(function(){
$(this).parent().find("input").val("");
$(this).remove();
});
function custAxis() {
if ($("#axisChk").is(":checked")){
$(".customAxis").show();
} else {
$(".customAxis").hide();
}
}
custAxis();
});
This is just a small snippet of all JS. I would like to include this JS, still keeping it as a part of the PHP variable but outside of PHP. Is it possible?
$myVar = '?>
// my JS
<? ';
you can use this format: