How would this (or does this) translate to SSJS? This would be part of the HTML body of a landing page.

%%[IF @var > 1 THEN]%%
Show this content
Show that content

1 Answer 1


Something like this:

<script type="text/javascript" runat="server">

Platform.Load("core", "1.1.1");

var var1 = Variable.GetValue("@var");  // or whatever

if (var1 > 1) {
  Write("Show this content");
} else {
  Write("Show that content");

I have an example here that shows a mixture of AMPScript and SSJS.

Also this official documentation is helpful: Server-Side JavaScript

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .