Cross posted to HowToSFMC from GORTONINGTON.
- Storing information in variables
- Operations and evaluations
- Event based scripts
How is Server-side Run?
Overview of Runtime processing: (for example, a web page)
- User accesses the URL via Browser. The browser sends request to server for page
- The server finds the appropriate file and begins processing
- The runtime engine constructs the HTML page that will be sent over
- It first begins with those that are set to run at server
- It then compiles the results of this along with the remaining HTML/CSS/JS to be shared
- The runtime engine sends the new, compiled HTML page to the client
- The web browser then interprets all client-side JS that was in the compiled page, formats the HTML and then displays the page As you can see from above, the SSJS is run before the HTML page is compiled fully and sent to the browser. Essentially what it does is scan the page from top to bottom and each time it sees a
runat=server it will then process and output that script instead of moving it across as content.
It then continues on with the scan until it reaches the end of the file. At this point it will have the ‘final’ rendered page that it sends back to the browser where then all the client-side scripting is run and processed.