WeOnlyDo! wodWebServer ActiveX - RunScript Method
      
 

Description

Called when script is found inside response body.


Return Type

None  


Syntax

object.RunScript Owner, User, ScriptData, ResponseData



The RunScript Method syntax has these parts:

Part Description
object An expression evaluating to an object of type IwodWebNotify.
Owner Required. A wodWebServerCom object. Reference to wodWebServer instance that called this notification method.
User Required. A WebUser object. Reference to user that is receiving response.
ScriptData Required. A String value. Full script data, as found in HTML content.
ResponseData Required. A String value. Response you should fill with content that will be sent to the user.

Remarks

NOTE: This method is called only if you implemented IwodWebNotify interface in your application, and wodWebServer.Notification property has received reference to instance of your implementation.

This notification method is called when wodWebServer finds content enclosed with markers defined in ScriptBegin and ScriptEnd properties in the response Body.  When such 'scripts' are found, this notification is called 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.