VBTrain.Net Documentation

LmsApi2.GetJsGetDiagnostic Function

Returns JavaScript that calls the SCORM function LMSGetDiagnostic (SCORM 1.2) or GetDiagnostic (SCORM 1.3).

Overloads Public Function GetJsGetDiagnostic( _ 
ByVal includeScriptTags As Boolean, _
Optional ByVal errorCode As String = "", _
Optional ByVal returnVarName As String = "returnValue" _
) 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>)
errorCode
Optional. Empty string or a string representing a SCORM error code integer. If an empty string is used, the LMSGetDiagnostic/GetDiagnostic function acts on the most recent error code.
returnVarName
Optional. Name of the JavaScript variable that will hold the LMSGetDiagnostic/GetDiagnostic return value.

Remarks

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

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 GetJsGetDiagnostic 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.GetJsGetDiagnostic(True, errCode, "errDiag"))
   .Append(apiObject.GetJsGetErrorString(True, errCode, "errStr"))
End With
Me.RegisterClientScriptBlock("errorInfo", sb.ToString)

See Also

LmsApi2 Class | LmsApi Members | GetJsGetErrorCode | GetJsGetErrorString