VBTrain.Net Documentation

LmsApi2.GetJsGetErrorString Function

Returns JavaScript that calls the SCORM function LMSGetErrorString (SCORM 1.2) or GetErrorString (SCORM 1.3).

Overloads Public Function GetJsGetErrorString( _ 
ByVal errorCode As String, _
ByVal includeScriptTags As Boolean _
) As String
Overloads Public Function GetJsGetErrorString( _ 
ByVal errorCode As String, _
ByVal includeScriptTags As Boolean, _
ByVal returnVarName As String _
) As String

Parameters

errorCode
A string representing a SCORM error code integer.
includeScriptTags
Boolean indicating whether or not to include the JavaScript opening and closing script tags. (i.e. <script language = 'javascript'> and </script>)
returnVarName
A string name for the JavaScript variable that will hold the LMSGetErrorString/GetErrorString return value.

Remarks

The JavaScript from the GetJsApiLocate function must be added to your page prior to using the JavaScript from GetJsGetErrorString.

You can use the server side RegisterClientScriptBlock method to add the JavaScript from any LmsApi GetJs function to your HTML page.

The JavaScript returned from GetJsGetErrorString will do all of the following:

Example

The following example assumes the VBTrain.WebTracking namespace has been imported.

[Visual Basic]
Dim apiObject As New LmsApi2()
Dim sb As New StringBuilder()
Dim errCode As String = "401"

With sb
   .Append(apiObject.GetJsGetErrorString(errCode, True, "errDiag"))
   .Append(apiObject.GetJsGetErrorString(errCode, True, "errStr"))
End With
Me.RegisterClientScriptBlock("errorInfo", sb.ToString)

See Also

LmsApi2 Class | LmsApi Members | GetJsGetErrorCode | GetJsGetErrorDiagnostic