- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
No way to output hubL variables in JavaScript file?
SOLVEMay 1, 2019 12:15 AM
I'm trying to access {{ group.absolute_url }} within a Javascript file, but I'm unable to get any of the 'standard' variables to output anything. No matter which variable I try it comes up an empty string.
Is this unsupported within pure JS files? I'm needing it for some JS trickery around the tag filter, which doesn't seem to have its own section to execute JavaScript within as it's a standard module (Or so I assume). Is there another approach I can take here that would work?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Accepted Solutions
May 1, 2019 12:52 PM
@BenDTU , you cannot add hubl code to a js file.
if you need it, you could make a hidden span with the {{ }} and then set it as a variable in js
or set an element attribute to it and find it. whatever is more appropriate for your scenario
Dennis
![]() | We are excited to announce that the Community will be launching a weekly newsletter on November 2, 2020! Sign up today! |
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content