Instead of creating a global variable, I'd suggest perhaps using an HTML5 data attribute in the template instead. You could then read from this attribute in existing.js and avoid the need for an inline script.