VBTrain.Net Documentation

LmsApi2.GetJsCommit Function

Returns JavaScript that calls the SCORM function LMSCommit (SCORM 1.2) or Commit (SCORM 1.3).

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

Parameters

checkForError
Boolean indicating whether or not to include error checking code in the JavaScript.
includeScriptTags
Boolean indicating whether or not to include the JavaScript opening and closing script tags. (i.e. <script language = 'javascript'> and </script>)
returnVarName
String name of the JavaScript variable that will hold the LMSCommit return value. The returnVarName parameter also serves as the prefix for any error checking variables, and as the prefix for the hidden field in which the return value is stored (<returnVarName>_hField). See Remarks below.

If not provided, the variable name "returnValue" is used.

Remarks

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

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 GetJsCommit 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()
			
With sb
   .Append(apiObject.GetJsApiLocate())
   .Append(apiObject.GetJsCommit(False, True))
   .Append(apiObject.GetJsFinish(False, True))
End With
Me.RegisterClientScriptBlock("commitAndFinish", sb.ToString)

See Also

LmsApi2 Class | LmsApi Members | GetJsApiLocate | GetJsFinish | GetJsTerminate