Back to product page
- Introduction
- License agreement
- Getting Started
- Enumerations
- Objects
- How to get support?
- Technical information
- Fast notifications interface
- Error list
RunScript event
Fired when script is found inside response body.
Syntax
- Basic
Private Sub object_RunScript (ByRef User, ByVal ScriptData, ByRef ResponseData)
The RunScript(object,User,ScriptData,ResponseData) syntax has these parts:
The RunScript(object,User,ScriptData,ResponseData) syntax has these parts:
object | An expression evaluating to an object of type wodWebServer |
User | WebUser object. Reference to the user who sent the request. |
ScriptData | String value. Full script data, as found in HTML content. |
ResponseData | String value. Response you should fill with content that will be sent to the user. |
Remarks
This event is fired when wodWebServer finds content enclosed with markers defined in ScriptBegin and ScriptEnd properties in the response Body.When such 'scripts' are found, this event is fired allowing you to replace original content in the response with dynamic one - created by your code. Typically, you could set your markers like this:
User.Response.ScriptBegin = "<%"
User.Response.ScriptEnd = "%>"
Assuming your HTML webpage that is returned to the client looks like this: Hi. You are coming from <b><%HOSTNAME%></b>. Current date is <b><%DATE%></b> then you can, for example, in RunScript do this:
If ScriptData = "HOSTNAME" Then ResponseData = User.RemoteIP
If ScriptData = "DATE" Then ResponseData = Now
which will cause connected client to receive your changes 'embedded' to the page.