VBTrain.Net Documentation

LmsApi2.GetJsGetLastError Function

Returns JavaScript that calls the SCORM function LMSGetLastError (SCORM 1.2) or GetLastError (SCORM 1.3).

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

Parameters

includeScriptTags
Boolean indicating whether or not to include the JavaScript opening and closing script tags. (i.e. <script language = 'javascript'> and </script>)
returnVarName
The name of the JavaScript variable that will hold the LMSGetLastError (SCORM 1.2) or GetLastError (SCORM 1.3) return value.

Remarks

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

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 GetJsGetLastError 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 js As String

js = apiObject.GetJsGetLastError(True, "errCode")
Me.RegisterClientScriptBlock("eCode", js)

See Also

LmsApi2 Class | LmsApi Members | GetJsGetErrorDiagnostic | GetJsGetErrorString