- From: Timo <notifications@github.com>
- Date: Wed, 18 Apr 2018 14:45:05 +0000 (UTC)
- To: whatwg/xhr <xhr@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Wednesday, 18 April 2018 14:45:31 UTC
I am looking for an alternative for sync XHR requests for our SCORM platform. The following code is an example as found in **thousands of existing and in use SCORM e-learning modules**. This (simplified) code is called by the content, follows the SCORM API, and **can not be changed(!)**: Example 1: ``` var initResult = api.Initialize(); if (initResult) { // start SCORM communication } else { // something went wrong } ``` Example 2: ``` var maxCount = api.getValue('interaction.count'); api.setValue('interaction.' + maxCount + '.foo', 'bar'); ``` Example 3: ``` var isPassed = api.getValue('passing_score'); if (isPassed > 0.8) { // do something... } ``` I think you got it ... ;-D The (SCORM-)api methods "Initialize", "getValue" and "setValue" are implemented by our LMS application and use sync XHR to **ensure data integrity**. As mentioned, the calling code is part of **third party content** and **can not be changed** to use promises, workers or the like. I would be pleased about suggestions, because currently I see no alternative for sync XHR in this case of SCORM API communication. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/whatwg/xhr/issues/20#issuecomment-382412317
Received on Wednesday, 18 April 2018 14:45:31 UTC