0

I am interested in using JavaScript on an ExactTarget landing page.

I'm hoping that the JavaScript I have on page can examine a cookie value, and based on this cookie value, set a variable in AMPScript.

If I were to use SSJS, would the JavaScript execute before the AMPScript, which would work as I hope, or would the AMPScript execute first, followed by the SSJS?

Adam Spriggs
  • 626
  • 8
  • 23
Eric Wiley
  • 15
  • 4

1 Answers1

0

You can't mix Server-Side JavaScript and client-side JavaScript. AMPScript and SSJS are both evaluated before the page is displayed. Setting a cookie value is a client-side operation, so there's no cross-over. However, you can use SSJS to output client-side JS.

SSJS is translated to AMPScript, so there's an additional overhead associated with its use.

I frequently use both SSJS and AMPScript at the same time in landing pages. Some things are easier and/or not supported in one or the other.

BTW, there is a lot more SFMC dicussion going on over in http://salesforce.stackexchange.com.

Adam Spriggs
  • 626
  • 8
  • 23