Hi All,
I'm looking to extend the delivery schema.
I've been able to do that fine, but I'd like to be able to add javascript Tags in the input form of the new field and make the tags execute.
E.g. like the subject field supports <%= recipient.firstName %> and replaces the tag with the recipient's first name value.
I've created a new string field on the delivery schema, but when I add a javascript tag like the above, it doesn't execute - it just shows the tag as a string.
Any ideas how to make the js tags execute?
Thanks
David
Solved! Go to Solution.
Hi,
The immediate answer is to just use eval(), e.g.:
var s = (@field + '').match(/<%=?(.+?)%>/)[1];
if (s) eval(s);
This isn't quite the same as what deliveries do, as they have a pre-parser which collects db tables and fields and populates data ala active record, to allow for things like <%= recipient.firstName %>. Nor is it similar to Dynamic JavaScript pages, which have a couple web server objects available.
Features can be added as needed though.
Thanks,
-Jon
Hi,
You can script the field's consumer to parse and render tags found in the fields.
Outside that, delivery and jssp are the only ootb features that render jssp tags afaik.
Thanks,
-Jon
Thanks Jon, appreciate the response.
Can you give a working example? (with screengrabs would be great) so i can replicate and know where things are to be added.
Views
Replies
Total Likes
Hi,
The immediate answer is to just use eval(), e.g.:
var s = (@field + '').match(/<%=?(.+?)%>/)[1];
if (s) eval(s);
This isn't quite the same as what deliveries do, as they have a pre-parser which collects db tables and fields and populates data ala active record, to allow for things like <%= recipient.firstName %>. Nor is it similar to Dynamic JavaScript pages, which have a couple web server objects available.
Features can be added as needed though.
Thanks,
-Jon
Views
Likes
Replies