I want to create a dust.js template but with inline javascript function. It that possible? The problem is with single '{' as a template character.
For instance:
<html>
...
<body>
<script>
function test(var) { alert('Hi {name} with ' + var); };
</script>
Hello {name}
</html>
Can I switch dust's special char to "{{"?
PS. I know that there's {~rb} but using it with inline JS would be a horror.
It works for me. Because you have parentheses, curly braces, and spaces inside of your curly braces, the content within the curly braces is not parsed as a Dust reference. Those characters are not legal characters for Dust references.
Try it out here for LinkedIn Dust or here for akdubya Dust.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With